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
JJJenkinsJJJenkins 

Field Validation ISBLANK(PRIORVALUE(field)

Hey Everyone - 

 

So I want to put in place a validation rule where they can't add to the field if it's blank but they can delete it.

 

 

OR(
(AND(PRIORVALUE(ISBLANK(field__c),
ISCHANGED(field__c)), (AND(PRIORVALUE(ISBLANK(field2__c),
ISCHANGED(field2__c)) )

 But it is telling me I have an error at the end of line 2 that I'm missing ")".

 

Suggestions?

 

Best Answer chosen by Admin (Salesforce Developers) 
Shashikant SharmaShashikant Sharma

Validation rules are executed at record save time. If an error condition is met, the save is aborted and an error message displayed. So no validation will come on deletion of record.

 

Try this one I hope will help you

 

OR(           AND(   ISBLANK(PRIORVALUE(Field1)) , ISCHANGED(Field1)   ),          AND(    ISBLANK(PRIORVALUE(Field12)) , ISCHANGED(Field12)   ))

All Answers

Shashikant SharmaShashikant Sharma

Validation rules are executed at record save time. If an error condition is met, the save is aborted and an error message displayed. So no validation will come on deletion of record.

 

Try this one I hope will help you

 

OR(           AND(   ISBLANK(PRIORVALUE(Field1)) , ISCHANGED(Field1)   ),          AND(    ISBLANK(PRIORVALUE(Field12)) , ISCHANGED(Field12)   ))

This was selected as the best answer
JJJenkinsJJJenkins

Thanks!