Loading

Troubleshoot Workflows with Debug Logs

Veröffentlichungsdatum: Oct 13, 2022
Beschreibung

You can use Debug Logs to troubleshoot Workflow Rules. They’re useful when you encounter scenarios similar to this:
  • Workflow rule seems not to trigger even though record meets criteria.
  • You want to understand the sequence in which workflows are being executed. 
Lösung

The first step for all the scenarios above, is to create a Debug Log for the user who is performing the action. When the log is created, you can search for the specific details that are relevant to the rule in question.
 

Creating a Debug Log for the affected user

In Salesforce Classic
  1. Setup | Monitor | LogsDebug Logs New
  2. On the lookup field, search for the user who is performing the action.
  3. Reproduce the action in question (create or edit a record to trigger the workflow).
  4. Go back to Setup | Monitor | Logs | Debug Logs and click the first log entry.
  5. View the details.

In Lightning Experience
  1. Click the Gear icon then Setup | Platform Tools Environments | Logs | Debug Logs | New
  2. On the lookup field, search for the user who is performing the action.
  3. Reproduce the action in question (create or edit a record to trigger the workflow).
  4. Go back to Setup | Platform Tools Environments | Logs | Debug Logs and click the first log entry.
  5. View the details.

Note: Debug log would only be able to capture logs from actions being done in the UI after the Save button is clicked.

See Also: Set Up Debug Logging


Understanding the Debug Log details

When a workflow rule is evaluated, you see something similar to this:

|WF_CRITERIA_BEGIN|[ObjectName Record Name RecordID]|WorkflowRuleName|WorkflowRuleNameID|ON_ALL_CHANGES

16:30:34.838 (838624000)|WF_FORMULA|Criteria

16:30:34.838 (838633000)|WF_CRITERIA_END|false
WF_ACTION| Field Update: 2
 

Definition: 

|[ObjectName Record Name RecordID|: The object in question (leads, contacts, accounts, and so on), the name of the record, and the Id of the record.
  • WorkflowRuleName | WorkflowRuleNameID: The name and Id of the workflow rule that is being evaluated against the record.
  • WF_CRITERIA_END | true or false: Whether the record meets the rule criteria. If you see the word True, then it means that the record meets the rule criteria. If you see the word False, it means that the record doesn’t meet the rule criteria. 
  • WF_ACTION|: The actions that are being executed if the record meets the criteria.  


You can use this information to determine:

  • Whether the record meets the rule criteria
  • The order in which rules are evaluated (by looking at the sequence of workflows being evaluated)


For example, assume you have the following:

  • A field update that changes the Opportunity Stage to Closed Won
  • An Opportunity record that meets the rule criteria


When the Opportunity record is saved, the Stage is changed to Review, instead of Closed Won. Upon creating a debug log, you find something similar to this:

|WF_FIELD_UPDATE|[ObjectName Record Name RecordID]|WorkflowRuleName|WorkflowRuleNameID

|WF_FIELD_UPDATE|[ObjectName Record Name RecordID]|WorkflowRuleName|WorkflowRuleNameID

|WF_ACTION| Field Update: 2;

 

This means that there are actually two field updates, and both of them are being executed (the record meets the criteria of both field updates).

It’s possible that the second field update is updating the same field with a different value. 

To see some additional helpful information, watch Troubleshoot Your Process Using the Debug Log.

Nummer des Knowledge-Artikels

000387340

 
Laden
Salesforce Help | Article