Sample.ValidateProperties

This sample script registers to the UpdateStates events for the entity types: File, Item and ChangeOrder.
The event is triggered when the lifecycle state of an entity is changed.

In our example we make use of the Restrictions event:

  • In the Restrictions event we check if the state is about to be changed to Released or in case of a ChangeOrder to Closed.

  • We also check if the user who is changing the state is the same who last modified the entity. If one of these rules is violated a restriction will be set.

Testing

In the default delivery the script is disabled and located in the %PROGRAMDATA%\coolOrange\Client Customizations\Disabled folder.
The customization can be tested by doing the following steps:

  1. Enable the script by moving it to the directory %PROGRAMDATA%\coolOrange\Client Customizations.

  2. Open the Vault Client.

  3. Navigate to an Item, File or Change Order which can be released and was last modified by another Vault user.

  4. Change the Lifecycle State to “Released” (or “Closed” for Change Orders).

  5. A restriction dialog appears informing the user that the Lifecycle State of the entity can’t be released (or closed) as it was most recently edited by another user.