This post is a part of the daily blog series
Day #9 – Validation on Cloned record #ISCLONE
Requirement: Is to not let the Users select Closed Won as the stage of the Opportunity when they clone an Opportunity. In other scenarios, when users clone a Closed Won Opportunity, they should be prompted to change the stage to a different one than Closed Won.
Solution:
For this, you can make use of the built in function called ISCLONE() to check if the record you are working is a cloned one or a brand new. Here’s the final validation rule.
Note that I added ISNEW() also to indicate that they cannot set Closed Won only when a cloned record is being created for the first time. With this condition in place, once they clone a record, save the opportunity (setting stage as anything other than Closed Won) and later as the user works on the opportunity, they can set it to Closed Won (after completing the required tasks of the Opportunity)
AND( NOT(ISCLONE()), ISNEW(), ISPICKVAL(StageName,"Closed Won") )
ISCLONE
Description: | Checks if the record is a clone of another record and returns TRUE if one item is a clone. Otherwise, returns FALSE. |
Use: | ISCLONE() |
Validation Rule Example: | Use (ISCLONE() to create a validation rule on an object and identify a record that’s a clone of another record. |
Tips: |
|
Read all other tips of the blog series here – A Tip A Day, daily dosage of learning!
One Reply to “A Tip A Day #9 – VALIDATION ON CLONED RECORD”