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
wcwill978wcwill978 

Cannot create opportunity as closed stage

Hi,

 

I've been trying to create a validation rule to prevent users from creating new opportunities as closed won based on another field. basically I have another field and if they eneter a value in this field I want them to get an error if they try to save it as closed won when the opportunity is new.

 

I tried using create date = NOW and create date = last modified date that does not work. This is the latest version i have:

 

AND(
IsClosed = TRUE,
IsWon = TRUE,
NOT (ISBLANK(Professional_Services__c)),
CreatedDate = NOW()

)

 

And here is another version I tried:

 

AND(
ISPICKVAL(StageName,"Closed Won"),
(NOT(ISNULL(Professional_Services__c))),
 CreatedDate = NOW()

)

 

Any help will be appreciated, just want to prevent them from creating new opptys as closed.

 

Thank you.

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

give this a try

 

AND(
IsWon,
ISNEW(),
NOT(ISBLANK(Professional_Services__c)))

 

 

All Answers

Steve :-/Steve :-/

give this a try

 

AND(
IsWon,
ISNEW(),
NOT(ISBLANK(Professional_Services__c)))

 

 

This was selected as the best answer
wcwill978wcwill978

Thanks Stevemo this worked great!

Steve :-/Steve :-/

No problem, you owe me a beer.  

 

btw - You don't need to evaluate IsClosed when you're testing Wins, IsWon can't be NOT(IsClosed) by default