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
shekhar 46shekhar 46 

firing Validation rule

can we fire validation rule when only record is inserted &  not on record updated?
Best Answer chosen by shekhar 46
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Shekhar,

Yes we can use ISNEW() function to check if this is creation or updation in validation rule.

Please find the article (https://help.salesforce.com/s/articleView?id=sf.customize_functions_isnew.htm&language=en_US&r=https%3A%2F%2Fwww.google.com%2F&type=5#:~:text=Checks%20if%20the%20formula%20is,updated%2C%20this%20function%20returns%20FALSE.) for the same.
Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Shekhar,

Yes we can use ISNEW() function to check if this is creation or updation in validation rule.

Please find the article (https://help.salesforce.com/s/articleView?id=sf.customize_functions_isnew.htm&language=en_US&r=https%3A%2F%2Fwww.google.com%2F&type=5#:~:text=Checks%20if%20the%20formula%20is,updated%2C%20this%20function%20returns%20FALSE.) for the same.
Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
 
This was selected as the best answer
Deepa K 27Deepa K 27
Hi Shekhar,

We can fire when creating a new recod or while modifying existing recrods.
ISNEW() -- It validates only new records
NOT(ISNEW() -- For existing records