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
PubNoahPubNoah 

Validation Help

I am having a big problem with this validation rule.  What am I doing wrong??  I want the validation to require that when "Demand Partner Numbers is selected in the picklist, both the DP Reporting Login URL and the DP Login Credentials fields are required.  Validation below.

 

=======

 

IF( 
AND( 
ISPICKVAL(Billing_Based_On__c,"Demand Partner Numbers"), 
OR( 
ISBLANK(DP_Reporting_Login_URL__c)), 
ISBLANK(DP_Login_Credentials__c)), 
TRUE, 
FALSE 
)

Best Answer chosen by Admin (Salesforce Developers) 
Satya.KonaSatya.Kona

AND(
ISPICKVAL(Billing_Based_On__c,"Demand Partner Numbers"),
OR(
ISBLANK(DP_Reporting_Login_URL__c),ISBLANK(DP_Login_Credentials__c))
)

 

This returns true when Demand Partner numbers is selected and if any of the other two fields is blank

(tat makes both the fields mandatory)

 

Let me know if this helps

 

--Satya

All Answers

Satya.KonaSatya.Kona

AND(
ISPICKVAL(Billing_Based_On__c,"Demand Partner Numbers"),
OR(
ISBLANK(DP_Reporting_Login_URL__c),ISBLANK(DP_Login_Credentials__c))
)

 

This returns true when Demand Partner numbers is selected and if any of the other two fields is blank

(tat makes both the fields mandatory)

 

Let me know if this helps

 

--Satya

This was selected as the best answer
Pradeep_NavatarPradeep_Navatar

Try this validation to achieve your requirement :

 

ISPICKVAL(Billing_Based_On__c,"Demand Partner Numbers") && (OR(ISBLANK(DP_Reporting_Login_URL__c),ISBLANK(DP_Login_Credentials__c)))

PubNoahPubNoah

Great!  Thank you.  This worked!

Pradeep_NavatarPradeep_Navatar

Please mark this question solved by clicking "Accept as Solution" button.

Satya.KonaSatya.Kona

Hey PubNoah,

 

Good to know that u got the solution.

Did u try my solution too, it worked for me so just curious if the expression was as required :-)

 

Pradeep's formula is much better and cleaner.