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
omarjmansour.ax1111omarjmansour.ax1111 

Help with a Close Date Workflow Rule

I am trying to create a work flow rule that pushes out the close date by 30 days (Close Cate+30) if the opportunity has not been set to Closed within 14 days of the Close Date.

 

Rule Criteria: IsClosed=FALSE

Evaluation Criteria: When a record is created, or when a record is edited and did not previously meet the rule criteria

 

Time-Dependent Workflow Actions

 

14 Days Before Opportunity: Close Date

 

Field to UpdateOpportunity: Close Date
Field Data TypeDate
Formula ValueCloseDate + 30

 

My question:

 

I have checked monitoring-->Time Based Workflow Rules. And it appears to be working fine for new opportunities that have been created after rule activation. But, the org has many opportunities that were already created that I would like this rule to impact.

 

Is there any way to do this with out creating a new opps record or editing each existing record?

 

Thanks in advance!

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,


You have to simplay update all the opportunity. You can update by using data loader, import wizard or you can simply write the SOQL query to simply update this.

 

Try the below code as reference:
List<opportunity> op=[select id from opportunity limit 10000];
Update op;


Execute this code on SystemDebug/DeveloperConsole.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

All Answers

Navatar_DbSupNavatar_DbSup

Hi,


You have to simplay update all the opportunity. You can update by using data loader, import wizard or you can simply write the SOQL query to simply update this.

 

Try the below code as reference:
List<opportunity> op=[select id from opportunity limit 10000];
Update op;


Execute this code on SystemDebug/DeveloperConsole.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

This was selected as the best answer
omarjmansour.ax1111omarjmansour.ax1111

I tried it in my dev org first and wow, that was really easy and powerful! Thanks for the help Navatar!!