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
Leonie ChristianiLeonie Christiani 

how to allow users to edit a particular field only when it is null

Looking to make a field editable by users only when it is null.  Once the field has a value i would like it to become read only.

Thank you!
LC

VinayVinay (Salesforce Developers) 
You can use validation for that.  Try below.
 
AND(OR(ISCHANGED(Fieldname),ISBLANK(Fieldname)),NOT(ISNULL(Fieldname)))

Hope this helps..

Thanks,
Leonie ChristianiLeonie Christiani
It works when i try to change the text in the account field however when i try to create a new account i get the same error when the field is either left blank or filled in.
Thank you
VinayVinay (Salesforce Developers) 
Check this.
AND(OR(ISCHANGED(Fieldname),NOT(ISBLANK(Fieldname))),NOT(ISNULL(Fieldname)),NOT(ISNEW()))