Ask Search:
Desiree LeslieDesiree Leslie 

When does the time-based workflow put records in it's queue?

I've setup a time-based workflow for contract expiration notifications at 30, 60 and 90 days.  I've checked and there are many in the time-based workflow queue, but several that aren't there either.  What I was wondering is if they aren't added because records already existed when I activated the workflow and haven't been subsequently created or edited since.  
So my questions is 'if there are already existing records in the system that match the criteria for your time-based workflow, do they get added when the workflow rule is activated? or only when the record is updated or created?'

Any help solving this mystery would be greatly appreciated.

Desiree
Marc PannenbergMarc Pannenberg
You have hit it exactly, Desiree. If the record already existed and already matches the criteria, it won't fire the workflow.
Desiree LeslieDesiree Leslie
Thanks Marc!  I thought that might be the case.

Is there an idea that I can vote on to have one that evaluates existing records?

Cheers,

Desiree
Marc PannenbergMarc Pannenberg
There might be... If it was a regular - non-TD workflow, then you could set your evaluation criteria to "every time the record is edited" and run an "empty" data load, i.e. update with just the ID of the records. This "touches" the record and causes the workflows to be evaluated. Unfortunately, you can't use that criteria with TD workflows.
Desiree LeslieDesiree Leslie
I thought something like that would work, but it seems like a checkbox that told salesforce to evaluate current records on workflow activation and then default to the standard record evaluation criteria after that would be a good idea.  I'll add it if it's not there.

Thanks for the quick response!
Marc PannenbergMarc Pannenberg
Thanks Desiree. Age of idea: 5 years. I'm not holding my breath :)
Marty ChangMarty Chang
Hello, Desiree, if you take Marc's suggestion one step further, the following solution may work for you:
1. Create a checkbox field on your target object called "Retroactively Triggers Workflow?"
2. Edit your workflow with the time-dependent action to "Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria"
3. Edit your workflow with the time-dependent action to include an OR condition for "Retroactively Triggers Workflow?" equals True
4. Do a mass data update to set "Retroactively Triggers Workflow?" to true for the records for which you want to queue up the workflow

After the workflow actions have fired, you can delete the temporary checkbox field.
Desiree LeslieDesiree Leslie
Very Clever.  I'll give it a shot!
Marc PannenbergMarc Pannenberg
Ha! Nice, hadn't thought of that. Let us know how it goes!
Desiree LeslieDesiree Leslie
Worked perfectly!! Thanks Marty!!