I want to mark a single field as read only when I clone a record. I am not able to find which page layout is in action when we clone a record


Another possible way to accomplish this is to use a validation rule.

While validation rules are not well suited to handle things of the form "prevent all fields from being edited except for fields x, y, z", validation rules can fairly easily handle locking down single fields.

In this case, using the ISCLONE() function in conjunction with ISCHANGED() should accomplish what you're looking to do.

  • Thanks Derek, that helped. validation rule option worked. – Sohel Shaikh Apr 7 '18 at 11:29

One way I can think of to accomplish this would be to assign a different recordtype to the cloned record. With the different recordtype, you can associate a new page layout to it (one that has your target field marked as read-only).

Of course, that either requires you to be cloning via Apex (so you can modify the recordtype prior to insertion), or having a trigger in place that checks isClone() (a method of the sobject class)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.