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
Sonu06Sonu06 

Validation Rule bypass

Hey guys , I am beginner to salesforce, my reqirement is i want to invoke validation rule only when  i am inserting the record and should not invoke when I am updating my record , also this is to be achived by using admin part and not through coding,, so it is possible ?? 

Note- Please dont share any link for this,, if possible give me explanation with example
thank you
Best Answer chosen by Sonu06
Khan AnasKhan Anas (Salesforce Developers) 
Hi Sonal,

Greetings to you!

You can check the record is new using ISNEW() function in a formula. It checks if the formula is running during the creation of a new record and returns TRUE if it is. If an existing record is being updated, this function returns FALSE. 

Use the following validation rule to prevent users from creating a record with a close date in the past. AND (ISNEW(), CloseDate < TODAY()) checks if the user is creating a new opportunity and, if so, ensures that the Close Date is today or after today.

You can use NOT(ISNEW()) to fire validation rule only in the update operation. Sample validation rule: 
AND(
NOT(ISNEW()),
ISCHANGED(City)
)

ISCHANGED() compares the value of a field to the previous value and returns TRUE if the values are different. If the values are the same, this function returns FALSE.

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas