Read-Only custom fields retain their value when cloning a record in Lightning
Last updated 2022-02-10 ·Reference W-6082532 ·Reported By 6 users
When cloning a record, custom fields that are Read-Only in Field Level Security and/or Page Layout will lose their value when the new record is created. The Classic UI adheres to this behavior, however, custom fields retain their value in the Lightning UI when the user has edit access via Field Level Security but READ-ONLY on the Page Layout.
1. In a clean org, navigate to Setup > Administration > Profiles > Clone next to Standard User.
2. Name the new profile Standard User with Customize Application and Save.
3. Edit, tick the perm Customize Application, then Save.
4. Create or edit a non-admin user, change its profile to Standard User with Customize Application, and Save.
5. Navigate to Setup > Object Manager > Case > Fields & Relationships > New
6. Complete the field creation wizard as follows:
* Field type: Text
* Field Name: Read-only On Layout Field Test
* Length: 255
* Visible to all profiles (leave Read-Only unchecked)
* (Leave Case Layout checked)
6. Navigate to Setup > Object Manager > Case > Case Page Layouts > [Arrow next to Case Layout] > Edit
7. Find 'Read-only On Layout Field Test' on the layout, click the wrench icon next to it, check Read-Only, click OK, then save the layout.
8. While still logged in as an admin, create a new test case, making sure that you've populate the field Read-only On Layout Field Test.
9. Once it's saved, copy the link to the case for the repro
1. Log in as the user from step #4 of the prep. Make sure you're using Lightning Experience.
2. Navigate to the link you copied in step #9 of the prep > Clone. Note when looking at the modal layout that Read-only On Layout Field Test contains the original value and is read-only. Save.
3. On the newly cloned case, scroll to Read-only On Layout Field Test and note that the value cloned from the original case even though the field was set to Read-Only on the layout.
4. While still logged in as the Standard User, click Switch to Classic and open the original case (same case from the beginning of this repro)
5. Click Clone, then Save.
6. On the newly cloned case, scroll to Read-only On Layout Field Test and note that it is empty.
Set Field Level Security to Read-Only on the custom field.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.