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
Mohit Kashyap 14Mohit Kashyap 14 

and( Batch_Master_Key_BMK_provided__c = true, Public_PGP_Key__c = NULL)

This is my first validation rule :
AND(
RecordType.DeveloperName = 'Final_Custom_Config',
$User.Bypass_Validation__c = False,

OR(
IF(
NOT(
OR(
ISPICKVAL(OTP_Protocol_Slot_1__c ,'Yubico OTP w/Yubicloud'),
ISPICKVAL(OTP_Protocol_Slot_1__c ,'OATH/HOTP w/Symantec VIP'),
ISPICKVAL( OTP_Protocol_Slot_1__c , 'None')
)
),
IF(ISBLANK(Public_PGP_Key__c), TRUE, FALSE), FALSE
),

IF(
NOT(
OR(
ISPICKVAL( OTP_Protocol_Slot_2__c ,'Yubico OTP w/Yubicloud'),
ISPICKVAL( OTP_Protocol_Slot_2__c ,'OATH/HOTP w/Symantec VIP'),
ISPICKVAL( OTP_Protocol_Slot_2__c , 'None')
)
),
IF( ISBLANK( Public_PGP_Key__c ) , TRUE , FALSE), FALSE
)
)
)

This is my second validation rule:
and( Batch_Master_Key_BMK_provided__c = true, Public_PGP_Key__c = NULL)


I have to combine the second VR into first in such a way that both VR should work. 
Arun Kumar 1141Arun Kumar 1141

Hi @Mohit,

 

To combine the second validation rule into the first one in a way that both validation rules should work together, you can use the OR operator to create a condition that checks both sets of conditions. Here's how you can do it:
 

AND(
    RecordType.DeveloperName = 'Final_Custom_Config',
    $User.Bypass_Validation__c = False,
    OR(
        /* First Set of Conditions */
        IF(
            NOT(
                OR(
                    ISPICKVAL(OTP_Protocol_Slot_1__c ,'Yubico OTP w/Yubicloud'),
                    ISPICKVAL(OTP_Protocol_Slot_1__c ,'OATH/HOTP w/Symantec VIP'),
                    ISPICKVAL(OTP_Protocol_Slot_1__c, 'None')
                )
            ),
            IF(ISBLANK(Public_PGP_Key__c), TRUE, FALSE),
            FALSE
        ),

        /* Second Set of Conditions */
        AND(
            Batch_Master_Key_BMK_provided__c = true,
            ISBLANK(Public_PGP_Key__c)
        )
    )
)


This is when you want RecordType.DeveloperName = 'Final_Custom_Config', $User.Bypass_Validation__c = False both of these conditions check with both the validation rule.
I hope this will help you.

Thanks!