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
Lloyd RuzLloyd Ruz 

How do I stop users editing an existing field value, but allow them to input data is the field is blank?

I am trying to make a validation rule which stops users editing the email address of a contact or lead UNLESS the email field is blank.

I have tried the following both formulae to no avail:
Email <> "" && ISCHANGED(Email)
IF( Email <> "", ISCHANGED(Email), ISBLANK( Email ) )

The reason for this is that the Salesforce record is checked against a nother databse which uses email address as the unique identifier, so whenever the email address is changed in Salesforce, it creates a duplicate record (with the new email address) in the other database.

Any help is much appreciated!

Best Answer chosen by Lloyd Ruz
kevin lamkevin lam

All Answers

kevin lamkevin lam
This was selected as the best answer
krupananda reddykrupananda reddy
Have a validation rule in such a way that if prior value is not blank and current value is changed then throw a valdiation error.
If(PRIORVALUE(Email) <> null && PRIORVALUE(Email)<>Email, true,false) or AND(ISCHANGED(Email),NOT(ISBLANK(PRIORVALUE(Email))))