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
HBroseHBrose 

How to set a reminder to change a close date field depending on stage.

I can not figure out how to define a rule that will either send a message to the user that they need to update the close date field, or send an error.  I do not care what the new date they set the opportunity is, they just need to alter it in some way.
Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/
Give this one a try

AND(
ISCHANGED(StageName ),
ISPICKVAL(StageName , "Deferred Decision"),
CloseDate < TODAY() + 90)

 

All Answers

Steve :-/Steve :-/

I set up Opportunity Update Reminders that are e-mailed to Opportunity Owners 15 Days before the Close Date and again 1 Day after the Close Date.  

 

I just have a simple Workflow Rule with 2 time dependent triggers.

 

 

 

Message Edited by Stevemo on 09-08-2009 03:30 PM
HBroseHBrose
Thanks! I have reminders already set, but I want them to change the date when they change the stage immediately.  I want them to be unable to move from the opportunity unless they've made a change.
Steve :-/Steve :-/
Okay, you're probably looking at something using an ISCHANGED or PRIORVALUE function that evaluates the Opportunity.Stage and then hits the Opportunity.CloseDate and spits out an error message if/when they try to save the record.
HBroseHBrose

Yes, exactly.  Any suggestions?

Steve :-/Steve :-/

Here's a simple one that I did that does not let them save the Opportunity if the Close Date has lapsed and the Opportunity is still open.

 

 

AND( NOT( IsClosed ), CloseDate < TODAY ())

 and here's another one that prevents them from Closing an Opportunity without updating the Close Date (our business rules require that the Close Date be the actual decision date)

 

 

AND( (IsClosed), CloseDate > TODAY ())

 

 

 

 

 

HBroseHBrose
I really appreciate your help, but still no. I have a rule for that, and most of the dates in this instance are in the future, just not far enough in the future.  We have a category called "Defferred Decision" which means the client hasn't said no, but it's probably further in the future than the current projected date.  So my goal here is to remind them if they change the stage to "deferred decision" they likely also need to change the close date, I do not care what the new date is and it may be anywhere from 30 days to a year before they are likely to close it.  I just want the reminder/error that says you need to alter this field as well if you choose that stage.
Steve :-/Steve :-/
So it sounds like when your user changes the Opportunity Stage to "Defferred Decision" you just need to evaluate the Close Date, compare it to Today, and throw an error if the Close Date < Today +30
HBroseHBrose

It keeps telling me TODAY is not a valid option. 

 

I have it set up as a workflow rule, is that the problem? So I want it to say if "deffered decision" is selected form the picklist, then the close date needs to be at least today + 90 days.  I can't seem to make the forumla work. 

 

 

Steve :-/Steve :-/

Can you post the formula using the clipboard icon [c] so I can take a look at it? 

 

What I posted earlier is just a lose interpretation of the formula, the actual code for the Today + 30 Days function would look something like this

 

CloseDate < TODAY() + 30

 

 

 

Message Edited by Stevemo on 09-09-2009 03:40 PM
HBroseHBrose
Specify New Field Value:
  Date Options
Steve :-/Steve :-/

Okay, I think we're not on the same page here. 

I thought that you wanted a Validation Formula that would evaluate the Opportunity.Stage and the Opportunity.CloseDate if the user changes the Stage to "Deferred Decision" and the Close Date is less than 30 days from the currrent date, and throw an error message instructing them to change the Close Date to something more than 30 days from today.  

 

In your post it looks like you are trying to do a Field Update (that function won't work there).  Am I missing something? 

Message Edited by Stevemo on 09-09-2009 04:43 PM
HBroseHBrose

Oh sorry wrong screen:

 

If this formula expression is true, display the text defined in the Error Message area
Steve :-/Steve :-/
No problem, sorry to be a pain in the ass, but can you re-post the code using the Clicpboard[c] icon above the message window?  or upload  a screenshot? it's a little tough to figure out what's code and what's not.
HBroseHBrose

StageName ISPICKVAL "Deferred Decision",CloseDate < TODAY() + 90

 

 

Sorry, I didn't see the clipboard function.  I know something is wrong, but code... it's not my strong suit.

Steve :-/Steve :-/
Give this one a try

AND(
ISCHANGED(StageName ),
ISPICKVAL(StageName , "Deferred Decision"),
CloseDate < TODAY() + 90)

 

This was selected as the best answer
HBroseHBrose
It worked! Thank you so much for help!
Steve :-/Steve :-/

That's why they pay me the BIG BUCKS!

 

 

when you speak of me, speak well :smileywink: