Master Rule and Field Rule criteria is saved within the scenario file and ALSO saved as separate xml files in the DemandToolsData\Master Rules directory. When loading a saved scenario, an automatic check is done to see if there is a Master Rule or Field Rule with the same name in the Master Rules directory. If no rule exists, then a new one will be created with the criteria saved in the scenario. If one exists with the same name, the criteria within the rule will be checked to see if it matches the logic in the saved scenario. If there is a discrepancy a pop-up will be shown with options to show the rule differences and then decide how to proceed.
1. Show rule differences: Click to show any discrepancies
2. Options to proceed:
- Save as new rule and keep
- Will be prompted to supply a name for the new rule
- A new rule will be created (xml file) with the selected name and will be shown in Screen 3
- New rule criteria will be used
- Will need to re-save the scenario to preserve use of the new rule
- Overwrite criteria in existing rule
- Update the criteria in the existing rule xml file to match the rule criteria saved in the scenario
- Ignore saved scenario rule and use existing
- Ignore the rule criteria in the saved scenario and use the criteria in the existing rule
- Will need to re-save the scenario to update the saved scenario rule logic to match the updates to the existing rule
- The check for missing fields or fields that no longer exist will still be done when attempting to merge the records and the user will need to re-save the rule to add/remove the fields accordingly
- Exit and Clear Scenario
- Abort loading the saved scenario altogether
Checking Field Rules for Validity
An automatic check is done when editing a saved field rule or merging records with a saved field rule to ensure that all fields in the table are accounted for.
- If fields have been added or deleted from the table in Salesforce since the last time the rule was saved, a pop-up will be displayed noting the discrepancies
- Clicking OK will allow editing/re-saving the rule
- When edit mode is invoked additional details noting the added and deleted field names will be displayed
- Any new fields will be added with the default Rule of Master, but can be updated as needed
Example when the field Primary__c has been deleted and LeadSourceHistory__c has been added
Pop-up when attempting to merge records with an invalid field rule. Click OK to edit the rule.
Pop-up when editing an invalid field rule.
New field, LeadSourceHistory__c added with the default rule option Master. Update rule option as desired and re-save the rule.
Loading a Saved Scenario with a Field Rule
Field Rules are saved locally on the PC as an xml file, but the logic within the field rule is ALSO saved as part of a saved scenario. A pop-up will be displayed if there is an existing Field Rule (xml file) with the same name as the one in the saved scenario but the criteria is different. The pop-up will have an option to Show Rule Differences with various options to resolve the conflict or exit loading the saved scenario altogether.
1. Show rule differences: Click to show any discrepancies
2. Options to proceed:
- Save as new rule and keep
- Overwrite criteria in existing rule
- Ignore saved scenario rule and use existing
- Ignore the rule criteria in the saved scenario and use the criteria in the existing rule
- Will need to re-save the scenario to update the saved scenario rule logic to match the updates to the existing rule
- The check for missing fields or fields that no longer exist will still be done when attempting to merge the records and the user will need to re-save the rule to add/remove the fields accordingly
- Exit and Clear Scenario
- Abort loading the saved scenario altogether