Use a Group of Approvers in a Workflow Utilizing a Workflow Action Script
Published on
August 31, 2023 at 9:13:15 AM PDT August 31, 2023 at 9:13:15 AM PDTst, August 31, 2023 at 9:13:15 AM PDT
Scenario
User needs toincorporatea certain group ofApprovers,SupervisorsorEmployeesto aWorkflowto handle the approval process ofa record.
Solution
1. Create aWorkflowactionscriptthat would check if the current user is a member of the Group of Approvers by navigating toCustomization>Scripting>Scripts>New. The logic will make use of an Entity Group search checking, if the user's internal ID belongs to the group. You also need to define aReturn Type(Free-Form Text) on the createdWorkflowaction script. Use the script below:
2. Create aStatewhere you want to initiate the customAction Script. Preferrably the initialStateon theWorkflow.
3. On the createdState, add a stateFieldthat would hold the returned value of the customScriptin Step 2. The returned value will be used as condition on the subsequent actions and conditions on theWorkflow.
Note:
Alternatively, the same logic can also be implemented using SuiteScript 2.0.