+ Start a Discussion
Chris760Chris760 

Why are time-based workflows not triggering?

So a little background... I have a master-detail relationship established between Opportunities (Master) and Invoices (Detail).  On the Invoices object, I have a number field called "Amount Due", a date field called "Due Date" and a checkbox called "Overdue".

 

So I have a timed workflow setup where, when Today = Due Date, a timed workflow is supposed to perform a field update on the Invoices object where the "Overdue" checkbox gets checked.

 

I then have a rollup field to the master (Opportunity) object that totals the "Amount Due" field on any Invoices where "Overdue" is checked.  So once the workflow triggers and checks the "Overdue" checkbox on the invoice, it should rollup the amount that's due on that invoice, to the "Amount Overdue" field on the Opportunity.

 

So it seems pretty straitforward to me... but for some odd reason, when the timed workflow is supposed to fire, nothing happens.  Instead, it just sits in the Time-Based Workflows queue for a few hours before it finally dissapears, like the system finally gave up and purged it.  When I create it as an immediate workflow, it works prefectly.  It's only when I create it as a timed workflow that it falls apart.  Also, when I create it as a timed workflow that checks another "Test" checkbox that's unrelated to the rollup, it work perfectly.  So it's just when it's a timed workflow that checks a checkbox that's needed to make a rollup work that everything seems to go haywire.

 

Does anyone know if there's some wierd criteria at play, where you're not allowed to make time-based workflows that set the required criteria for a rollup field?  If so, what's the work-around for that?  I'm really at a loss here.

Vinita_SFDCVinita_SFDC

The pending action in the queue do not fire always. Time-dependent actions remain in the workflow queue only as long as the rule criteria for the workflow rule is still valid. If a record no longer matches the rule criteria, Salesforce removes the time-dependent actions queued for that record.

For example, an opportunity workflow rule may specify:A criteria set to "Opportunity: Status not equals to Closed Won, Closed Lost."An associated time-dependent action with a time trigger set to seven days before the opportunity close date. If a record that matches the criteria is created on July 1st and the Close Date is set to July 30th, the time-dependent action is scheduled for July 23rd. However, if the opportunity is set to "Closed Won" or "Closed Lost" before July 23rd, the time-dependent action is automatically removed from the queue. Please refer to Time based workflow considerations and FAQa at following links:

http://login.salesforce.com/help/doc/en/workflow_time_action_considerations.htm

https://help.salesforce.com/HTViewSolution?id=000005245&language=en_US

It is difficult to figure out without debug logs, you can debug by setting up the debug logs at: Your name|Setup|Administration setup|Monitoring|Debug logs

Hope this helps!