How to check if the document entered verification?

Question

How can the document be marked if the document entered verification?

 

Answer

There is no built-in way to do that, but it can be done using the script stage after the Verification stage that will check the stage the document was transferred from:

  1. Create a new checkmark field in the document definition that will contain the value that will depend on the fact that the document entered the Verification stage. 
  2. If needed set the read-only property so that the Verification operator wouldn't try to change the value manually on the Verification. The value will be changed by the script anyway, but the "read-only" property may be set to avoid confusion.
  3. Create a script stage of the "Document Processing" type in the workflow.
     ​
  4. ​Put the following script that checks if the document has "Verification" as a value for the previous stage and sets the checkmark value accordingly. 
    //C# code

    var stage = Document.PreviousStageInfo.StageName;
    Document.Field("test\\EnteredVerification").Text = (stage == "Verification") ? "Yes" : "No";
    If entry conditions for the Verification stage were not met and the Verification stage was skipped, the Document.PreviousStageInfo.StageName property returns an empty string.
    Please note how we refer to the document definition and its field name when trying to change its value.
  5. This script stage will need to be moved right under the Verification stage.

Additional information

IDocument
IField
IStageInfo

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.