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

there is one object X and when trying save the record for particular field getting error as 'read only field', what is issue for it?

William TranWilliam Tran
The field level security of the field is set to read only so you can not change the content of the field and save the changes.

As a common practice, if your question is answered, please choose 1 best answer. 
But you can give every answer a thumb up if that answer is helpful to you. 

DeepthiDeepthi (Salesforce Developers) 
Hi Lakshman,

I believe the profile is assigned with read-only permission for the field of that object. If you want to change its field level security then navigate to the profile --> look for Field Level Security --> Choose the object X --> then you will find a window showing all the fields and with two columns Visible and Read-only
  • If you check for field with Visible checkbox then the field will be allowed with edit functionality to all the users of that profile.
  • If you check with Visible + Read-only checkboxes then the field is with read-only functionalty.
  • Salesforce will not allow to check with Readonly for a field
  • If neither of the fields is selected then the field is hidden from the users of that profile.
Hope this helps you!
Best Regards,