Monday, March 11, 2019

Set a custom list field dynamically via the Workflow Manager


This workflow demonstrates on how to dynamically increment a field of type = List/Record without any user interaction. On this sample, a custom entity field on a Customer record. Once the record is updated, the custom field selects the next value; thus, incrementing the field value of 1.
1. Create a new workflow by navigating to Customization > Workflow > Workflows > New.

2. Define the workflow
   a. Name = Increment list dynamically
   b. Record Type = Customer
   c. Sub Types = Customer
   d. On Update = True
   e. Release Status = Released
   f. Trigger Type = After Record Submit
   g. Click Save.

3. To add a workflow state, click New State and set Name = Increment Field, then hit Save

4. To create an action to the state, click on the Increment Field state and click New Action
   a. Select Set Field Value.
   b. Trigger On = After Record Submit
   c. Field = <<custom entity field>> 
   d. Formula = {custentity15.id} + 1 //custentity15.id is the current Internal ID value of the custom entity field
   e. Save.

If the Customer record is updated, this workflow will be triggered. However, if this will be used in a scheduled workflow, the action's trigger must be set to Entry. 

No comments:

Post a Comment