Does anyone know if there's a way to add more comments to the CommArray for a certain state? I would like to be able to keep an existing comment when moving from one state to another. I'm listening to the pre/post-events of DocumentServiceExtensions.UpdateFileLifecycleStateEvents, extracting the "currentComment" in PRE, and trying to write it to the new version of the file in POST:
private string currentComment = ""; void UpdateFileLifecycleStateEvents_Pre(object sender, UpdateFileLifeCycleStateCommandEventArgs e) { VaultServiceManager _vltMgr = CommonMain.Instance.VaultServiceManager; File[] files = _vltMgr.WebServiceManager.DocumentService.GetLatestFilesByMasterIds(e.FileMasterIds); try { currentComment = files[0].Comm; } catch (Exception) { } }
void UpdateFileLifecycleStateEvents_Post(object sender, UpdateFileLifeCycleStateCommandEventArgs e) { VaultServiceManager _vltMgr = CommonMain.Instance.VaultServiceManager; File[] files = _vltMgr.WebServiceManager.DocumentService.GetLatestFilesByMasterIds(e.FileMasterIds); try { files[0].Comm = currentComment; } catch (Exception) { } }
The new state always has it's own predefined comment from the dropdown in the "change state dialog". The e.Comment is "readonly" and not possible to change...And since - is there a way to modify this dialog before it shows?
The comments are part of the lifecycle and are fully customizable. You don't need to write code to customize them.
In Vault Explorer, go to Tools >> Administration >> Vault Settings >> Behaviors tab >> "Lifecycles ..." button >> choose lifecycle and press Edit to bring up the dialog (see attached screenshot). Each state has a list of comments (shown in the "Comments" tab on the right).
-Dave