To verify that your business rules are working correctly, you can use the following tools:
- Check the Policy Execution Records
- Use the Test Console
- Generate a Salesforce debug log
Details on each of these steps are provided below.
If after going through these steps you are unable to resolve the issue, please grant login access to Decisions on Demand support and then submit a support ticket providing the following information:
- The Org ID showing the incorrect behavior
- The name of the business policy involved
- Link(s) to the related Salesforce record(s)
- Link(s) to the associated Policy Execution Record(s) (if any)
- Description of expected and actual behavior
- Which rule(s) where you expecting would apply?
List all rules in all relevant tables - Which rules actually applied, according to the execution record or test console execution details?
Use Debug or Trace mode in the Test Console to get more detailed logging if relevant
- Which rule(s) where you expecting would apply?
- Salesforce debug log information (if available)
If the problem occurs in a production org where you cannot grant login access, please try to reproduce it in a Sandbox. If that is not possible please provide details of the records involved, in particular:
- The relevant fields on the Salesforce record(s), and the relevant parts of the record history
Surrounding the time it was (or should have been) processed by the business policy - The contents of the relevant execution record(s)
Checking Policy Execution Records
If enabled, every execution of the Decisions on Demand engine can generate a Policy Execution Record documenting the logic applied and the results. To view and check these records, follow the steps below:
- Check to see if there are Policy Execution Records
- Navigate to the Policy Execution Records tab, select All, then sort on Date and time (descending)
If there are recent records linked to the policy you expect to see being applied, this confirms the policy is being applied
Note that Policy Execution Records are not generated if the Default execution log level for the policy is set to -- None --
You can verify this setting on the policy detail page
- If you want to understand how the rules behaved for a specific record, locate the corresponding execution record(s)
- You can create a list view with appropriate filter conditions to narrow down the records you see
- Alternatively, you can add a Policy Execution Log related list to the detail page for the object type in question
This supported by default for standard objects incl.. Lead, Account and Opportunity. Contact us if you need the related list configured for another object type
- Check the Result and Action(s) applied columns to understand at a high level what happened
- for additional detail, click on the Execution ID for the appropriate record to see details of the execution
The Details tab includes information of record(s) loaded and a trace of all rules applied - If necessary, you can increase the level of detail generated for future records by setting the Default execution log level for the policy to Debug or Trace
This is not recommended for long term use in a production org due to the volume of data generated. But it can be used for a targeted period to understand tricky issues
Using the Test Console
If the issue is not clear from the execution records, you can use the Test Console to apply rules to selected records.
For basic instructions on how to use the Test Console, see this article
If that does not provide enough information, you can run tests with enhanced log level, as follows:
- Open the policy detail page
- Click the Test button
- Set the Execution log level to Debug or Trace
- Select the records to test
You may want to create a few test records similar to the ones causing issues -- that gives more flexibility in trying multiple scenarios - Click the Details link for records that are failing -- at this log level, you will see not only the rules that applied, but also the reasons why other rules did not apply
For instance, an entry like:
-- Assignment row 13 not matched: checkSetValueContainsAll((Assignment Eligible, SMB), [LeadProfiles]Midsize)
indicates that row 13 in the Assignment table expected the Midsize Lead Profile, but the lead matched only Assignment Eligible and SMB
If necessary, adjust your rules and test again to verify correct behavior
Check the Salesforce debug log
If the rules appear correct but they do not work at runtime, you can check the Salesforce debug logs, assuming you have admin rights.
To do so, there are two options:
- If the problem is reproducible under your user login (or another admin user if you can login under their name):
- Log in as the user in question (if applicable)
- Open the Developer Console
- Reproduce the problem and check the log that is generated in the console
- In other cases, generate a debug log under Setup (see the Salesforce help for more details)
This will work for any user, and also allows you to capture logs for events that happen at unpredictable times (for instance if the issue only occurs when an actual lead is generated from a marketing automation tool such as Marketo or Hubspot).
The steps are:- Navigate to Setup->Monitor->Logs->Debug Logs
- Set up a log for a user that can reproduce the problem
- Trigger an policy execution, either using a Custom Button or by updating a record in a way that triggers the business policy, or wait for an event to occur.
Details will depend on your specific setup