This tutorial walks you through the process of creating a Bionic rule that automatically fills a Date field when a milestone is applied to a CTA. For the purpose of this tutorial, we use a custom field called Last EBR Date and fill it with the date when a milestone is created.
Perform the following steps to update an EBR date:
- Create a Custom Field (Date field)
- Give permissions to Date object
- Create a Rule with Milestone Date
- Configure Rule by using Advanced Logic (Optional)
Create Custom Field (Date field)
In this step, create a custom field in SFDC Account object - call it “Last EBR Date”.
To create the Custom Field, perform the following steps:
- Click the dropdown on your name to navigate to the Object Page.
- Click Setup.
- Type Objects in the quick find box.
- Click Customize.
- Scroll down and click Accounts
- Click Fields.
- Scroll down until Account Custom Fields & Relationships is visible.
- Click New.
- Scroll down and click Date.
- Click Next.
- Type in an appropriate Field Label.
- Field Name is auto populated after clicking in the field.
- Provide description in Description (optional) area.
- Click Next.
- Depending on the desired access levels, the Field-Level Security settings may be changed.
- Click Next.
- Verify all information is correct.
- Select the required Page Layout Name(s).
- Click Save.
Give Permissions to Date Object
In this procedure, we are providing the Admin access to the ID and Date object, to use them in the Rules Engine. The ID object is used as an identifier for the Date object.
Note: You can access the Settings area only if the permission set called Gainsight Special is added to your user’s profile.
- Navigate to Administration > Rules Engine.
- Click Rules Settings.
- In the Permissions (Load Actions) section, Click Add Object.
- Select Native Data and Account object. The list of available fields are displayed.
- Select ID and EBR Date fields checkboxes.
- Click SAVE.
Create a rule with Milestone Date
After providing permissions to Account ID and Date objects, create a rule with Milestone as the source object.
Name the Rule
Rule Type: Select Bionic.
- Rule For: Select Account.
- Rule Name: Update EBR Date by Milestone Date
- Folder: Select a folder for the rule.
- Description: < Something denoting intent of the rule>
- Click NEXT. Setup Rule page appears.
- Navigate to Administration > Rules Engine.
Setup Rule
- Select Salesforce as the data source.
- Select Milestone as the source object.
- Add the following fields to the Show fields section:
- Milestone :: Milestone Created Date
- Milestone :: Account
- Milestone :: Milestone Name
- In the Filter section, set Milestone :: Milestone Created Date | equals | Rule Date.
- If the rule is scheduled to run Daily, then the above condition is applicable.
- If the rule is scheduled to run weekly, then filter must be Milestone Create Date greater Subtract N days Rule Date = 7.
- Click SAVE.
Setup Action
- Click + ACTION and select the dataset.
- Select Load to SFDC Object for the Action Type.
- The following three fields will auto populate (Created from the "Show" section on Rule Setup).
- Milestone Created Date (Date)
- Account (REFERENCE)
- Milestone Name (Text)
- Map the following fields as:
- Milestone Created Date (DATE) → Last EBR Date (DATE)
- Account (REFERENCE) → Id (ID)
- Click SAVE and run the rule.
Gainsight recommends running the rule at the end of the day.
Configure rule using Advanced Logic
If you have multiple milestone dates, you can use the Filters section while setting up a rule. For more information on creating a new rule, refer to the Create a New Rule article. Once the filters are configured, you can use the Advanced Logic section to apply logic to those filters.
Filter on Milestone Created Date:
- For instance, if you need to fetch only Opportunity Won, then you need to add an AND Filter: A AND B.
- If you need to fetch multiple milestone dates, then you can add OR Filter: A AND ( B or C).
- Here B, C are filters on Milestone Name.
.png?revision=1)
Setting Dates for Past Milestones
If you want to fetch all the milestones for the past one year, then it is not recommended to use this tutorial. It is suggested to edit the rule to fetch all the milestones created in a month and run for historical runs for last year, this way you will run the rule 12 times an year. On completion of the rule run, change the rule to daily scenario (that means milestone created date = RuleDate) and schedule to run daily (time stamp end of the day).
Rule Configuration to fetch all the Milestones created in a month
A: Milestone Created Date greater or equal First Day of Current Month
B: Milestone create date less or equal Last Day of Current Month.
(A AND B) AND ( C OR D OR …)
Here C, D are filters on milestone names.
Schedule this rule:
- Choose Monthly
- On Day 1st of Every Month
- Start Date: Your Choice
- End Date: Today’s Date.
- Time Zone: Your Choice.
- Select for historical runs.
After the rule is scheduled, change filters to fetch milestones daily (Milestone created Date = RuleDate) and schedule to run daily.