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 

Validation rule to apply is field is not blank

I have to make it impossible to edit the Email field UNLESS the field is blank.

I tried the following Validation but it didn't work:
Email <> ""
&&
ISBLANK( Email )

Any suggestions as to why?
 
Himanshu ParasharHimanshu Parashar
Hi LIoyd,

You can try
 
if(!ISBLANK(Email) && !ISNULL(email),true,false)

Thanks,
Himanshu
Salesforce Certified Developer | Administrator | Service Cloud Consultant

P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
Lloyd RuzLloyd Ruz
Himanshu, this formula doesn't work in the way I need it to.

I need to stop users from editing the email address field UNLESS the field is blank, in which case they are allowed to edit the field.

This formula for some reason affects the editing of oither fields like Phone. Any idea why?
Chad GerthChad Gerth
NOT(ISBLANK(fieldname__c)) 

 
ShekharGawaliShekharGawali
Hi LIoyd,

The validation rule can be written with following formula:
ISCHANGED( Email ) && (NOT(ISBLANK(PRIORVALUE(Email))))

Regards,
Shekhar