This article explains the procedure to create a CTA when a customer's Account Type changes from one state to another. For example: You can create a CTA when the customer’s Account Type changes from ‘Customer’ to ‘Expired/Terminated’ state. To achieve this, we will create a custom field and run a rule consisting of the following actions.
- Create an action to push the Account Type field value to the Previous Account Type (custom) field.
- Create a second action to trigger a CTA when the Account Type changes from Customer to Expired/Terminated.
Create the custom field (PreviousAccountType)
Perform the following steps to create the required custom field:
- Navigate to Setup > Customize > Account > Fields in Salesforce.
- Click New.
- Select the Field Type as Text.
- Click Next.
- Enter the field name/label as Previous AccountType.
- Enter the length of the field as 255.
- Select the profiles to which you want to grant edit access to this field via field-level security.
- Select the required page layouts that should include this field.
- Click Save.
Create the rule
Note: We will create a rule with two actions. The first action will map the Account Type field value to the Previous Account Type (custom) field. The second action will trigger a CTA when the Account Type changes from Customer to Expired/Terminated.
- Navigate to Administration > Rules Engine.
- Create a rule by clicking the + RULE button.
- Select the rule type as Bionic.
- Select the rule for Account. Enter the required rule name and description.
- Click NEXT.
- Select DATASET TASK.
- Add the following fields to the Show section:
- Account::Account Type
- Account::Previous AccountType (custom field)
- Click SAVE. Navigate to the Setup Action section.
- Click + ACTION and select the task name created in the previous step.
- Select the Load to SFDC Object action type.
- Select the Object Name as Account, and Operation as Update.
- In the Field mappings section, map the fields as specified below:
- Id → Id
- Account Type → Previous AccountType (Custom field)
- In the Criteria section, add the following criteria:
- Account Type = Value = Customer
This maps the Account Type value to the custom field (Previous AccountType) that we created in the preceding section.
- Click +ACTION again and select the task name.
- Select the Call to Action action type.
- Select the required fields as specified in the following screenshot.
- Add the following criteria:
- Account Type = Value = Expired/Terminated
- Previous AccountType = Value = Customer
- Click SAVE. Run the rule by clicking the RUN NOW button.
The required CTAs will be created when the Account Type is changed from Customer to Expired/Terminated.