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
ShrinivasShrinivas 

Need validation rule help

Hi Team,

Can you please help me to write a new validation rule using below condition.

If(Group__c = "SW" then B_Sub_Group = should be either "IS" or "GC") And ( Group__c = "C"CS then B_Sub_Group should be "CST")

Thanks in Advance
Tamilselvam BTamilselvam B
HI Srini Vasu,

If(OR(AND(Group__c = "SW", OR (B_Sub_Group=='IS',B_Sub_Group=='GC'), AND( Group__c = "CS", B_Sub_Group =="CST"), true, false)

Please try this and mark this right answer if it's correct.

 
Raj VakatiRaj Vakati
Try this 
 
If(OR(
AND(Group__c = "SW", OR(B_Sub_Group=='IS',B_Sub_Group=='GC')),
AND( Group__c = "CS", B_Sub_Group =="CST"))
)

 
Tamilselvam BTamilselvam B
Hi Srini Vasu,

Please try this

If(OR(AND(ISPICKVAL(Business_Group__c,"SW"), OR (B_Sub_Group=='IS',B_Sub_Group=='GC'), AND( ISPICKVAL(Business_Group__c,"CS"), B_Sub_Group =="CST"), true, false)
 
SathishPanjalaSathishPanjala
If Both Group and Subgroup fields are pick list values then the below rule should work..

If(OR(
AND(ISPICKVAL(Business_Group__c , "SW"), OR (ISPICKVAL(B_Sub_Group, 'IS'), ISPICKVAL(B_Sub_Group, 'GC'))), 
AND(ISPICKVAL(Business_Group__c,"CS"), ISPICKVAL(B_Sub_Group, "CST")))
)

Please mark it as solved if it goes.