Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change file state

1 REPLY 1
Reply
Message 1 of 2
erik.martinsson
300 Views, 1 Reply

Change file state

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?

 

1 REPLY 1
Message 2 of 2
minkd
in reply to: erik.martinsson

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

 



Dave Mink
Fusion Lifecycle
Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report