+ Start a Discussion
Chris760Chris760 

Timed-Workflows Not Firing?

So I have a timed workflow setup where...

 

When: Invoice.dueDate == TODAY

//It triggers a field update:

Invoice.overdueCheckbox = TRUE)

 Then I had a rollup on the parent object (the opportunity) that sums the total of the amount overdue for that account.

 

Strangely though, the timed workflow doesn't want to fire.  It will just sit in the the Time-Based Workflow Queue for hours and hours after it hits its scheduled date-time, and then it will finally just dissapear... like the system finally gave up and purged it.

 

When I tried making a time-based workflow that updates another checkbox that doesn't trigger the rollup, it DOES work (almost imediately), so it's aparently some kind of weird evaluation criteria related to rollup fields that I'm not familiar with.  I checked out the "Time Based Workflow Considerations" page, but didn't see anything in there about rollup fields preventing time-based workflows from firing.

 

I've tried combining it with apex to see if I could work around it (by triggering an After Update to update the rollup checkbox after the time based workflow updates the non-rollup checkbox) but, once again, the workflow just hangs out in the queue after it's been triggered until the system finally purges it.

 

I've even tried using the @future method to initiate the update that way, but once again, the field update just hangs out in the Time-Based Workflows queue before it finally gets purged.  I'm so stumped right now that my head literally hurts.  What am I missing?  Does anyone have any ideas as to how to work around this or what evaluation criteria will cause a workflow to purge without firing?  Is scheduled apex the only way?  I'd really like to use some of the standard salesforce automation features before resorting to that, but I'm kind of running out of ideas here.  Any thoughts at all would be a huge help... I'm totally all ears.

 

Thanks guys.

Best Answer chosen by Admin (Salesforce Developers) 
Chris760Chris760

Ehh well, who knows why the timed workflows aren't firing, but I just realized that my @future method was updating the record in a recursive loop, which was why it wasn't working.  I just created a static boolean variable that gets updated when the DML is performed and prevents incoming records from being sent to the future class again during DML update.  So getting it done using an apex trigger has finally worked, but like I said, no idea why the standard workflows wouldn't work.  

 

I found this really vague article about some update about workflows and rollup fields (http://blogs.developerforce.com/systems-integrator/2009/04/critical-update-workflow-rule-and-rollup-summary-field-evaluations-update.html), but nothing in there stands out to me as criteria that would keep the timed workflow from firing.  Oh well.  Work-around is implemented and working.