Using Buttons to Execute Transitions
You can use a button to execute a transition in a workflow instead of a server trigger. Use the Add Button action to add a button to a state and create a transition that executes on the button click and moves the record to the next state in the workflow.
For example, add Approve and Reject buttons to approve or reject a purchase approval. The Approve button transitions the record to an Approved state and the Reject button transitions the record to a Rejected state.
Use the following example to create an Approve button and a transition from State 2 Pending Approval to State 3 Approved.
To add a button and use the button to initiate a transition:
-
Open a workflow and select the state that you want to transition from in the diagrammer.
For example, choose State 2 Pending Approval.
-
In the context panel, click New Action.
-
In the New Action window, click Add Button.
-
Make sure Before Record Load is selected for Trigger On and enter a button label in the Label field under Parameters. For other Add Button action properties, see Add Button Action Parameters.
-
Click Save.
-
In the diagrammer, hover over the bottom of the state that you want to transition from. The cursor becomes a filled half-circle.
Drag the icon to the state to which you want to transition and release the mouse to create the transition.
-
Select the transition in the diagrammer and click the Edit icon on the Transition tab in the context panel.
-
In the Workflow Transition window, leave the Trigger On field blank and choose the button you created in the Button dropdown list.
-
Click Save.
In the above example, when the record enters State 2: Pending Approval, an Approve button appears on the record form. Clicking the button transitions the record to State 3: Approved. Add a Set Field Value action in State 3 to set the approval status of the record to approved.
SuiteFlow prevents workflow instances and actions from processing simultaneously when workflow buttons are clicked multiple times. See, Add Button Action Guidelines.