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
cinziet23cinziet23 

Workflow rule to trigger when a value is changed twice

HI all,

 

is there a way to add a workflow rule that gets triggered when a value is changed twice?

 

For example a closed date is set to 15/04/2013 in january, the in April it is changed to 15/05/2013 and in May it is changed again to 15/09/2013.

I would like to know if there is a way to at that moment have the rule evaluated to true in order to send an email alert.

 

The aim is to identify sales opportunitis which keep on moving right on the calender and get moved from quarter to quarter.

Maybe there are other ways to track it?

 

Many thanks in advance

Cinzia

Best Answer chosen by Admin (Salesforce Developers) 
larrmill59larrmill59

You can do this with 2 workflow rules. Here are the pieces.

1. Create a number field on the oppty object with a default value of 0 (Opportunity_Pushed__c in this example)

2. Create a workflow rule that increments this field by one whenever the close date changes

 

ISCHANGED( CloseDate ) is the workflow criteria (has to be set to "Evaluate the rule when a record is:created, and every time it’s edited.")

Opportunity_Pushed__c +1 is the formula for the field update

 

3. Create a second workflow rule that sends the alert whenever that value is greater than or equal to 2

 

On the first workflow rule, be sure to check the box for "re-evaluate workflow rules after field change"

 

All Answers

Bhawani SharmaBhawani Sharma
Do you only want to send the notification, when the date change to Next or Other Quarter ?
cinziet23cinziet23

Hi and thanks for answering.

 

I would like to send it when it moves to next or other quarter...but I would like as well to keep track of opportunities which keep on shifting in the future.

That is why the alert when something is moved twice.

 

Thanks and regards

Cinzia

larrmill59larrmill59

You can do this with 2 workflow rules. Here are the pieces.

1. Create a number field on the oppty object with a default value of 0 (Opportunity_Pushed__c in this example)

2. Create a workflow rule that increments this field by one whenever the close date changes

 

ISCHANGED( CloseDate ) is the workflow criteria (has to be set to "Evaluate the rule when a record is:created, and every time it’s edited.")

Opportunity_Pushed__c +1 is the formula for the field update

 

3. Create a second workflow rule that sends the alert whenever that value is greater than or equal to 2

 

On the first workflow rule, be sure to check the box for "re-evaluate workflow rules after field change"

 

This was selected as the best answer
Bhawani SharmaBhawani Sharma
If you only want to keep track of the date changes, then you can turn on history tracking for that field and put your workflow for quater change notification.

Other approach is: you can create one more date field. When the Close date change first time, populate value is new date field with Close Date old value using workflow PRIORVALUE(CloseDate). If close date change second time, then check if New date field and CloseDate is not equal, then Close Date is changing second Time, use your notification action and reset the new date field.
cinziet23cinziet23
many thanks, this is so interesting.

Regards
Cinzia
cinziet23cinziet23

Many thanks this is also an interesting solution.

 

Thank you for helping me reflecting so much on the workflow rules.

 

Regards

Cinzia