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
Kalpana DhanajayarajKalpana Dhanajayaraj 

Help reg Validation Rule

Requirement : When Sales Channel = Partner, the Primary Agency field should contain a partner of type "Agency TS" or "RPO"

AND( 

NOT( $Profile.Id = $Label.Profile_Sys_Admin_3rd_Party), 
NOT( $Profile.Id = $Label.Profile_Sys_Admin_No_Cust), 
OR 
($RecordType.Id = $Label.RT_CorpSolutions, 
$RecordType.Id = $Label.RT_CorpSolutions_Renewal ), 
ISPICKVAL( Sales_Channel__c , "Partner") , 
OR( 
NOT(INCLUDES(PrimaryAgency__r.Relationship_Type__c, 'Agency TS')), 
NOT(INCLUDES(PrimaryAgency__r.Relationship_Type__c, 'RPO'))) 
)

I want the Validation Rule  to fire only when both of the mulstiselect picklist value is not present.
Now it is firing even when one value is present.Record is getting saved when only both RPO and Agency TS are added.
Also i am not able to inlcude other values also.
How to get this corrected
Maharajan CMaharajan C
HI Kalpana,

Try using the AND operator instead of OR Operator in your second OR Condition.Like Below

AND( 
NOT(INCLUDES(PrimaryAgency__r.Relationship_Type__c, 'Agency TS')), 
NOT(INCLUDES(PrimaryAgency__r.Relationship_Type__c, 'RPO'))) 
)

Let me know if you want any further help.

If those points are help means mark these as a best answer.

Thanks,
Raj
(Sweet Potato Tec)
 
Kalpana DhanajayarajKalpana Dhanajayaraj
Hi,
I tried Using AND at first.
But it did not help.