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
SFDC n12SFDC n12 

Validation rule help needed

Hi,

I need help to write a valdiation rule for following requirement


1) i am having a picklist field called as "Type__c" if the value of type is set to "Other Adjustment"  then i am having other 2 picklist fields like "Month__c" and "Year__c" should be mandatory


IF(
AND(
NOT(
ISPICKVAL(Type__c, 'Other Adjustment')),ISBLANK( ADR_Move_From_Month__c),ISBLANK( ADR_Move_From_Year__c)), true, false)


Not sure what should i replace with "Isblank" since its a picklist value

Thanks in Advance

 

Best Answer chosen by SFDC n12
Ravi NarayananRavi Narayanan

IF(
AND(
NOT(
ISPICKVAL(Type__c, 'Other Adjustment')),ISBLANK( TEXT(ADR_Move_From_Month__c)),ISBLANK( TEXT(ADR_Move_From_Year__c))), true, false)

 

try this

All Answers

Ravi NarayananRavi Narayanan

IF(
AND(
NOT(
ISPICKVAL(Type__c, 'Other Adjustment')),ISBLANK( TEXT(ADR_Move_From_Month__c)),ISBLANK( TEXT(ADR_Move_From_Year__c))), true, false)

 

try this

This was selected as the best answer
Pratik_MPratik_M
Hi,

IF(
AND(
NOT(
ISPICKVAL(Type__c, 'Other Adjustment')),ISPICKVAL( ADR_Move_From_Month__c, ' ' ),ISPICKVAL( ADR_Move_From_Year__c, ' ')), true, false)

Try this and let me know if any issues.
Pratik_MPratik_M
Hi,

For picklist field, ISBLANK doesn't support, you can use ISPICKVAL(picklistfield, '').

Thanks,
Pratik