function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Balayesu ChilakalapudiBalayesu Chilakalapudi 

Timebased workflow rule for a field update on Opportunity not firing

I want to update a field of Opportunity object with a time dependent workflow action. I have created a workflow rule and added a criteria. it is
CloseDate LESS THAN Today
I added time dependent action as field update and it will fire 1 hour after rule trigger date.
I activated the rule.When i check the time based workflow queue my workflow rule is not listing there. can any one please help me to resolve this issue. any help will be liked.

Thanks,
Balayesu
Best Answer chosen by Balayesu Chilakalapudi
Ashish Agarwal 31Ashish Agarwal 31
Hi Balayesu,

You can follow these steps if you want the workflow you created to fire for the existing opportunities :

1) Go to Developer Console and query on Opportunity fetching all the Opportunities where CloseDate < TODAY
 
list<Opportunity> opportunityList = [SELECT Id , CloseDate FROM Opportunity WHERE CloseDate < TODAY
];
2) Now just update the list you received
update opportunityList;
This will make your workflow fire.

3) Go to Setup|Monitoring|Time Based Workflow and you should see the time based workflow queued for every record updated.


Thanks

All Answers

Sarvesh_OjhaSarvesh_Ojha
Hi Balayesu,

When you create an Opportunity reminder rule, it doesn't run against existing Opportunities. The new rule only applies to records created or updated after the rule is activated.

There is a way to test time based workflow.  Trigger the workflow, then go to Setup|Monitoring|Time Based Workflow and see that the action has been queued (you can also see what time it's queued for).  If anything happens between when you triggered the action and when it's actually supposed to happen that violates the workflow criteria then the action(s) will be unqueued.

Regards,
Sarvesh
Balayesu ChilakalapudiBalayesu Chilakalapudi
Hi Sarvesh, Thanks for the reply.
Is there any option available for dealing with existing records based on their closedate?
Ashish Agarwal 31Ashish Agarwal 31
Hi Balayesu,

You can follow these steps if you want the workflow you created to fire for the existing opportunities :

1) Go to Developer Console and query on Opportunity fetching all the Opportunities where CloseDate < TODAY
 
list<Opportunity> opportunityList = [SELECT Id , CloseDate FROM Opportunity WHERE CloseDate < TODAY
];
2) Now just update the list you received
update opportunityList;
This will make your workflow fire.

3) Go to Setup|Monitoring|Time Based Workflow and you should see the time based workflow queued for every record updated.


Thanks
This was selected as the best answer