Having Two text fields Document_Id__c and Confirm_Document_Id__c. Once the Document_Id__c is filled the Confirm_Document_Id__c field must not be blank and must check whether it contains the value or characters as same as Document_Id__c or else should throw an error. If the Document_Id__c field is blank , the Confirm_Document_Id__c is also be left blank. I tried the following validation rule but it save the record if the Document_Id__c is blank.

OR( AND(NOT(ISBLANK(Document_Id__c )),ISBLANK(Confirm_Document_Id__c )), AND(NOT(ISBLANK(Document_Id__c )),NOT(ISBLANK(Confirm_Document_Id__c )),NOT(Confirm_Document_Id__c = Document_Id__c ), NOT(Document_Id__c = Confirm_Document_Id__c) ))

1 Answer 1


You could probably think a lot simpler. What about this:

Document_Id__c <> Confirm_Document_Id__c

If any of them is empty and the other isn't, then it will trigger the validation. If any of them is filled and not matching the other, it will also trigger the validation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .