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
Nitin SharmaNitin Sharma 

Validation rule on lead object

Scenario: Email field on lead object. When user create a record email id field is mandatory but when user edit or update record its not mandatory .
how can i achive this with one validation rule.
Best Answer chosen by Nitin Sharma
Amit Chaudhary 8Amit Chaudhary 8
You can try IsNEW
AND
(
	ISNEW(),
	ISBLANK( email )
)

Let us know if this will help you

All Answers

Amit Chaudhary 8Amit Chaudhary 8
You can try IsNEW
AND
(
	ISNEW(),
	ISBLANK( email )
)

Let us know if this will help you
This was selected as the best answer
Nitin SharmaNitin Sharma
Hello Amit
it work but i dont undersatnd what is happening behind this..
Because AND operator return true when all the arguments are true.  But when we edit record ISNEW return false and ISBLANK return true.Then how it work.?
Thanks
Amit Chaudhary 8Amit Chaudhary 8
As you know we are using AND in that case all condition should be true. If any condition will false then it will not execute. So in case of new ISNEW() will true in other case it will false. Means it will execute in case of Insert only.

So as per our requirement it should be run on insert so i used ISNEW() so in case of insert only it will true in all other case it will false
Nitin SharmaNitin Sharma
ok now got it..
Thanks