A Tip A Day #9 – VALIDATION ON CLONED RECORD

This post is a part of the daily blog series 

A Tip A Day, daily dosage of learning!

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:
  • This function cannot be used with fields.
  • Use the NOT function to reverse the return values of TRUE and FALSE.

Read all other tips of the blog series here – A Tip A Day, daily dosage of learning!

Advertisement

One Reply to “A Tip A Day #9 – VALIDATION ON CLONED RECORD”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: