I have a workflow rule that should be creating a Task when someone creates a new opportunity with an amount over $500. But for some reason it isn't triggering (yes, I checked to make sure it's active). What is the easiest way to diagnose why it isn't firing? Can you test formulas on objects in the developer console?


Open the Developer Console, change the default Log Levels (Debug > Change Log Levels... > Add/Change > Workflow=FINEST), then perform an operation (insert/update/whatever).

Change Log Levels

You'll see a new log, that will contain lines like this:

15:36:02.2 (398764976)|WF_RULE_EVAL_BEGIN|Workflow
15:36:02.2 (398983642)|WF_CRITERIA_BEGIN|[Client: demo 0011T00002Pndvj]|Sleeper|01Q50000000Vbn6|ON_CREATE_ONLY|0
15:36:02.2 (399204257)|WF_FORMULA|Formula:ENCODED:[treatNullAsNull]TRUE|Values:
15:36:02.2 (399217206)|WF_CRITERIA_END|true
15:36:02.2 (399248294)|WF_CRITERIA_BEGIN|[Client: demo 0011T00002Pndvj]|test|01Q50000000ANNk|ON_CREATE_OR_TRIGGERING_UPDATE|0
15:36:02.2 (404759899)|WF_RULE_FILTER|[Client : Account Name not equal to ]
15:36:02.2 (404799829)|WF_RULE_EVAL_VALUE|demo
15:36:02.2 (404811979)|WF_CRITERIA_END|true
15:36:02.2 (405486758)|WF_SPOOL_ACTION_BEGIN|Workflow
15:36:02.2 (405877275)|WF_FIELD_UPDATE|[Client: demo 0011T00002Pndvj]|Field:Client: Account Number|Value:12345|Id=04Y50000000PwIf|CurrentRule:test (Id=01Q50000000ANNk)
15:36:02.2 (405913719)|WF_ACTION| Field Update: 1;
15:36:02.2 (405922278)|WF_RULE_EVAL_END

This will show you all the rules, including the filter (WF_RULE_FILTER), the values (WF_RULE_EVAL_VALUE), and the result (WF_CRITERIA_END), plus the actions executed (WF_ACTION). This will help you identify the issue with your configuration.

You can also just run an execute anonymous script (Debug > Open Execute Anonymous Window), and run some code directly, such as:

Account a = new Account(Name='Test');
insert a;
Opportunity o = new Opportunity(StageName='Prospecting',AccountId=a.Id,CloseDate=Date.today());
insert o;

There's a checkbox at the bottom to automatically open the log after execution. Keep in mind that this is a live execution environment, so you'll need to clean up the records you create/update afterwards.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.