When I manually edit and save the record to match a criteria that activates a time based workflow, the actions are queued up as expected in the time based monitor workflow.

But when apex updates fields and then the corresponding record with a matching criteria, the time based workflow is not being queued at all. The field is updated properly. But the workflow never gets queued.

Any idea on what's going on and how to tackle it?

Here's an example where both the fields are set correctly by Apex, but the workflow is never queued up. Am I missing something?


Case.StatusReport__c = 'Somevalue'
Case.StatusTimeSetOn = System.now();
update Case;

Time Based Workflow:

Criteria: When Case.StatusReport__c = 'Somevalue'
1 hour after Case.StatusTimeSetOn
Action: Update Case.StatusREport__c ='Anothervalue'

Sigh. Found the solution finally.

All I had to do was check "Re-evaluate Workflow Rules after Field Change" on the field update associated with the workflow.

| 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.