Overview
In this business scenario we want to save an Account record's last Category choice. To do this, we have created a custom field called Previous Category.
Whenever the field Category is changed we want the previous value to be stored in the custom field Previous Category. We use the PriorValue function to achieve this.
Note: For this example we have created a custom field called Previous Category which has the same optionset values/numbers as the field Category
North52 Decision Suite
The North52 Decision Suite solution works like this:
- A formula is created that will trigger whenever the Category field is updated on an Account record
- When triggered, the formula will update the Previous Category field with the previous value of Category
Setup Decision Table
- Navigate to Settings > N52 Formula
- Create a new formula, setting the following values in the Formula Guide:
- Source Entity set to Account
- Set Formula Type to Save - Perform Action
- Select the Decision Table editor
- Change the Name of the formula to Save an Accounts last Option Set choice
- Expand the Source & Target
- For Source Property select Category
- Expand Deployment Settings
- For Pipeline Stage select Pre-Operation (Synchronous)
- In the Decision Table editor
- Select cell A2
- Go to the Source tab
- Expand Source and find and select Previous Category
- Select cell A4
- Copy and paste the following function:
PriorValue('[account.accountcategorycode]')
- Copy and paste the following function:
- Select cell A2
- Click Save
Test
- An an Account record, change the Category field and save. You will see the Previous Category field change to the previous category value
- Note it is advised to add the custom field Previous Category to the Account form for easy access
- EntityMulti