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
Nithish KrishnasamyNithish Krishnasamy 

(validation rules ) I have an status (picklistfiled) 1)status is closed 2)once the record id created ,then dont rewrite the status value

Shri RajShri Raj

To prevent rewriting the status field once it has been set to "Closed", you can create a validation rule that checks if the record has been previously saved, and if so, it will not allow changing the status field to a value other than "Closed". Here is an example of how to write such a validation rule:
AND(
    NOT(ISNEW()), 
    ISPICKVAL(Status, "Closed"), 
    NOT(ISPICKVAL(PRIORVALUE(Status), "Closed"))
)

 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Nitesh,

Do you meant if the record is craeted with Closed status then we should not allow users to edit the status field?

Thanks,