Confirmation Pages for Custom Commands
The following use case is supported by this configuration:
-
When executing a custom command, the user can select to apply the command also to documents of Document Type ‘Object’.
-
The user can enter an optional comment why the command is applied to documents of Document Type ‘Object’.
-
For documents of Document Type ‘Object’, a line is added to the workflow if the command is applied and a comment is entered.
Configuration
You can download the configuration which implements this use case here. This configuration does not depend on any external components. It can be imported into an empty Vault and will be fully functional.
Helper Functions
Starting the batch
Functionality implemented:
-
Set dialog title.
-
Ask if the command should be applied to documents of Document Type ‘Object’.
-
Enter an optional comment.
CopySub ConfirmationDemo_PreInitialize(Batch)
Batch.ConfirmationTitle = "Confirmation Demo - Initialize batch"
Batch.AskConfirmation "CONF_ConfirmationDemo", "Do you want to apply this command also to objects?", AS_CDV_YES, AS_COMMENT_OPTIONAL
End SubThe user interface for the input is shown in a page before the first wizard page:
Processing a document (repeated for each document)
Functionality implemented:
-
Check if the Document Type for the document is ‘Object’
-
If so, check if the command should be applied to it.
-
Apply the command to as needed.
-
If the Document Type for the document is ‘Object’ and if a comment is entered, add it to the document log.
CopySub ConfirmationDemo_Execute(Batch)
Dim sComment
If Not Document Is Nothing Then
If Document.DocumentType.InternalName = "Object" Then
If GetConfirmation (Batch, "CONF_ConfirmationDemo", AS_CDV_NO) = AS_CDV_YES Then
Batch.PrintDetails "ConfirmationDemo applied to " & Document.DocumentType.DisplayName
sComment = GetComment (Batch, "CONF_ConfirmationDemo", "")
If sComment <> "" Then Document.Log "ConfirmationDemo applied: " & sComment
End If
Else
Batch.PrintDetails "ConfirmationDemo applied to " & Document.DocumentType.DisplayName
End If
End If
End Sub