Example: Set field based on a workflow status change
Consider the following example: The date when a record's workflow status changes to "Closed" should be captured for reporting purposes. You can accomplish this as follows:
- Create a workflow status named "Closed" and assign it the integration code "C."
- Create a Date field for the object named "Closing Date." Only add this field to the view page so it is essentially treated as a read-only field.
- Create a workflow action named "Close" that changes the status to "Closed."
- Create an Update Field Value trigger named "Record Closing
Date" with the following configuration:
Timing After Update On Field Change Workflow Status Field to Change Closing Date Change Value Formula "{!status#code}"=="C" ? new Date() : null
As soon as the status is changed to "Closed" (regardless of whether this change was invoked by the workflow action, manual record editing, another trigger, API call, or other source of change), the current date will be stored in a the Closing Date field as shown in the screens below.Before status change:
After changing the status on the edit page: