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
Carolina W 2Carolina W 2 

Make a field only read after create

I want that the user only can edit an opportunity field when he create the opportunity. 
After that, the field have to be only read.
Best Answer chosen by Carolina W 2
CharuDuttCharuDutt
Hi  Carolina
Try The Following Code In Validation rule. 
AND(NOT(ISNEW()) , ISCHANGED(Name))
In This Will Throw Error And Will Not Allow To Edit Opportunity Name.
You Can Change the Field Name You Want To Make Read Only. 

Please Mark it As Best Answer If it helps.
Thank you.

All Answers

ANUTEJANUTEJ (Salesforce Developers) 
Hi Carolina,

You can simply create a profile or modify an existing profile where you can edit to have read and create permissions and remove edit and delete permissions.

This would help you to make sure the user is able to create the record and unable to edit i.e., have read access only after record creation.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.
CharuDuttCharuDutt
Hi  Carolina
Try The Following Code In Validation rule. 
AND(NOT(ISNEW()) , ISCHANGED(Name))
In This Will Throw Error And Will Not Allow To Edit Opportunity Name.
You Can Change the Field Name You Want To Make Read Only. 

Please Mark it As Best Answer If it helps.
Thank you.
This was selected as the best answer
Carolina W 2Carolina W 2
@CharuDutt, Thank you so much! 
It solved my problem!