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
Admin-JenniAdmin-Jenni 

Close date validation rule

Hi There,

 

I am trying to build a validation rule which prevents sales people from closing opportunities with the close date in the future. Especially when the opportunity is closed lost, they quite often don't change the close date and just leave the expected close date, which can be months ahead.


Any suggestions? I already use the close date cannot be prior the current month, maybe this could be altered ?

 

AND(OR (ISNEW(),ISCHANGED( CloseDate )),
CloseDate < DATE( YEAR(TODAY()), MONTH(TODAY()), 1) )

 

Thanks,

Jenni

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Here's one I use on my SFDC org:

 

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

 

All Answers

Steve :-/Steve :-/

Here's one I use on my SFDC org:

 

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

 

This was selected as the best answer
Steve :-/Steve :-/

and here's another I use to prevent Lapsed Opportunties.

 

AND(
IsClosed = FALSE,
CloseDate < TODAY (),
$Profile.Name <> "System Administrator")

 

 

 

Steve :-/Steve :-/

Are you all set or do you still need help?

Admin-JenniAdmin-Jenni

All set now and new functionality installed. Many thanks for your help !!

Steve :-/Steve :-/

No problem, you owe me a beer!

ssrssr

Hi Steve,

 

How to write validation for start time and end time and vice versa startdate and end date

 

scenario1: End Date should not be less than start date.

scenario2: End Time Should not be less than start time.

 

Please help me onthis these two are related to customization.

 

 

Steve :-/Steve :-/

Hi ssr,

 

What is the datatype of the fields you're referencing?

Brett Hawke 3Brett Hawke 3
Hi Steve, I require your expertise.  I have one where I am trying to ensure that the field "Start Date" is always the same date as the close date of the opp, sounds easy, probably is but im battling.  Is this a validation rule or formulae field update?