Setting property values based on workflow transitions

It can be convenient for some property values to be set automatically at specific transitions in a document’s workflow. This can be done by determining the state to which a document is being routed and setting property values accordingly. Meridian provides many constants that you can use, including the AS_WF_STATE enumeration used in the following example.

Sub DocWorkflowEvent_AfterChangeWFState(Batch, SourceState, TargetState, Person, Comment)
    If TargetState = AS_WF_APPROVED Then
       Document.ApprovedOn = vbDate
       Document.ApprovedBy = User.FullName
    End If
    If TargetState = AS_WF_UNDERCHANGE Then
       Document.ApprovedOn = Null
       Document.ApprovedBy = ""
    End If
End Sub

Related concepts

VBScript examples

Validating unique property values

Clearing the property values of copied documents

Sending email messages

Related information

The Meridian API constants