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
deepakMdeepakM 

Need validation rule on created date field for new opportunity created.

HI everyone

 

i have one validation rule like below

 

MONTH(CloseDate) < MONTH(TODAY())

 

it works fine but i need it to fire only for a new opportunities not for old.

 

for that purose i did this

 

AND( 
Id =='0', 
MONTH(CloseDate) < MONTH(TODAY()) 

)

 

but it not work .

 

please guide me what can i do to achieve this.

 

 

Thanks.

 

Best Answer chosen by Admin (Salesforce Developers) 
Gunners_23Gunners_23

I guess what  you're referring to is you want to fire on Insert not on Update

 

If that is the case you can use ISNEW() function in validation rules

All Answers

Gunners_23Gunners_23

I guess what  you're referring to is you want to fire on Insert not on Update

 

If that is the case you can use ISNEW() function in validation rules

This was selected as the best answer
deepakMdeepakM

thanks

 

i did like this and it works.

 

AND( ISNEW(),MONTH(CloseDate) < MONTH(TODAY()))