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
Sienna Luard 3Sienna Luard 3 

I need update a Validation Rule so that users with a Partner Community profile do NOT get an error msg. 

I have created the following validation rule that makes  lookup field on our Competitor Custom object mandatory. 

https://na64.salesforce.com/03d0g000000Timy/e?setupid=OpportunityValidations&retURL=%2F03d0g000000Timy%3Fsetupid%3DOpportunityValidations

It uses this formula which works great.

AND ( 
ISPICKVAL( StageName , "Closed Lost"), 
INCLUDES( Reason_Lost__c , "Competitor") , 
ISBLANK( Competitor__r.Id ))

I need update the formula so that users with a Partner Community profile do NOT get an error msg. 

I have been trying to insert this into the formula, but it is not working.

$Profile.Name <> "Partner Community User")

How should I update the formula to NOT apply to Partner Community Users?
Best Answer chosen by Sienna Luard 3
SandhyaSandhya (Salesforce Developers) 
Hi,

Try to use below formula 
AND ( 
ISPICKVAL( StageName , "Closed Lost"), 
INCLUDES( Reason_Lost__c , "Competitor") , 
ISBLANK( Competitor__r.Id ),
    AND($Profile.Name <> "Partner  Community User")

)

Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
                                             
Best Regards
Sandhya
 

All Answers

SandhyaSandhya (Salesforce Developers) 
Hi,

Try to use below formula 
AND ( 
ISPICKVAL( StageName , "Closed Lost"), 
INCLUDES( Reason_Lost__c , "Competitor") , 
ISBLANK( Competitor__r.Id ),
    AND($Profile.Name <> "Partner  Community User")

)

Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
                                             
Best Regards
Sandhya
 
This was selected as the best answer
Sienna Luard 3Sienna Luard 3
That works perfectly.

Thanks so much!

Sienna