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
Dan_CDan_C 

Date field editable one time only.

I've been searching the sfdc help pages and these boards for a few days now, and I cant seem to find a discussion on it.

 

I want to create a Date field that can only be editable one time, after that one edit I want it to become read only. Is this possible?

Best Answer chosen by Admin (Salesforce Developers) 
David81David81

A validation rule should do it for you....

 

 

AND(ISCHANGED( YOUR_DATE_FIELD ),NOT( ISNULL(PRIORVALUE( YOUR_DATE_FIELD ))))

 

 

All Answers

David81David81

By "editable one time only" do you mean that it can be "set" initially and never changed or it can be "set" then changed once then not edited again?

Dan_CDan_C

What I mean is, the date field starts out empty. It can remain empty and editable until someone enters any date. After that fist entry it becomes read only.

David81David81

A validation rule should do it for you....

 

 

AND(ISCHANGED( YOUR_DATE_FIELD ),NOT( ISNULL(PRIORVALUE( YOUR_DATE_FIELD ))))

 

 

This was selected as the best answer
Dan_CDan_C

This works perfectly.

 

Thanks David!