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
Renee Marie ProrokRenee Marie Prorok 

Multiple OR statements with an And statement

Having trouble getting this to work - if I take out one of the OR statements, it works, but the value needs to be checked against both OR statements. Any advice?

AND(
NOT(ISBLANK( Service_Provider__c )),
OR(
Service_Provider__r.Customer__r.Customer_Key__c   <>   Related_Property_Customer__c,
Service_Provider__r.Customer__r.Customer_Key__c   <>   "gobydataservices"))
Best Answer chosen by Renee Marie Prorok
Charisse de BelenCharisse de Belen
Hi Renee,

It sounds like you only want this formula to evalute to true if the Customer_Key__c field is neither of those values. But because of the OR statement, if Customer_Key__c is either one of the values specified, the formula will still evaluate to true as long as Service_Provider__c is not blank.

For example, if Customer_Key__c is "gobydataservices", the OR statement will still be true because Customer_Key__c is NOT EQUAL to Related_Property_Customer__c.

If you change that OR statement to an AND statement, then the formula will only evaluate to true if Service_Provider__c is not blank and Customer_Key__c is neither of the specified values.

I hope this helps! Please let me know if I am misunderstanding the requirement and/or you would like extra explanation.

All Answers

Charisse de BelenCharisse de Belen
Hi Renee,

It sounds like you only want this formula to evalute to true if the Customer_Key__c field is neither of those values. But because of the OR statement, if Customer_Key__c is either one of the values specified, the formula will still evaluate to true as long as Service_Provider__c is not blank.

For example, if Customer_Key__c is "gobydataservices", the OR statement will still be true because Customer_Key__c is NOT EQUAL to Related_Property_Customer__c.

If you change that OR statement to an AND statement, then the formula will only evaluate to true if Service_Provider__c is not blank and Customer_Key__c is neither of the specified values.

I hope this helps! Please let me know if I am misunderstanding the requirement and/or you would like extra explanation.
This was selected as the best answer
Renee Marie ProrokRenee Marie Prorok
Yes, that worked perfectly! Thank you so much!