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
msglsmomsglsmo 

Validation Rules requiring two fields to match, if another field is blank

Good Morning, All,

 

It is my first day back from vacation, but apparently my Salesforce knowledge is apparently still on vacation.

 

I am trying to create a simple (I thought) validation rule that require the standard "Name" field and the custom field "Corporate Name" match exactly, but only if the standard field "Parent Account Name" is blank.

 

I came up with:

 

 

AND(
ISNULL( Parent.Name),
(Name <> Corporate_Name__c ))

 

 

That did not work.


What am I missing?

 

Thanks in advance!

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

 

AND( 
LEN(ParentId) < 1, 
(Name <> Corporate_Name__c ))

or if you're not into the whole brevity thing man...

 

 

AND(
ISBLANK( Parent.Name),
(Name <> Corporate_Name__c ))

 

 

All Answers

Steve :-/Steve :-/

 

AND( 
LEN(ParentId) < 1, 
(Name <> Corporate_Name__c ))

or if you're not into the whole brevity thing man...

 

 

AND(
ISBLANK( Parent.Name),
(Name <> Corporate_Name__c ))

 

 

This was selected as the best answer
msglsmomsglsmo

Thank you, thank you, thank you!!!

 

Worked like a charm!

Steve :-/Steve :-/

The Dude abides...