Writing scripts for events

Each action consists of scripted events. These events determine what the user can do and how the user input should be processed by the system. For example, a user processing a formula approval workflow is asked to view the formula, then select Approve or Reject. This action contains VIEW, APPROVE and REJECT events, even though only two of the three events occur.

Selecting the appropriate button activates the scripted event. The event instructs the system to open a formula, approve the formula, or reject the formula. This collection of events constitutes one action.

This table shows one example for scripting each event:

Event Script
VIEW Opens the Formula form. Instructs the system to advance to the next event.

Dim rc As Long
rc = StartForm("frmformula")
Return 1
APPROVE Shows this message to the user. Instructs the system to advance to the next action.

Dim message As Long
message = MessageList("You approved this formula.")
Return 111
REJECT Shows this message to the user. Instructs the system to cancel the workflow.

Dim message As Long = MessageList("Workflow cancelled.")
Return 9111

Return codes conclude each event and instruct the system to move forward, pause or cancel the workflow.

Refer to the Infor PLM for Process Scripting Administration Guide, which contains detailed information about conventions and functions for workflow scripting.