+ Start a Discussion
ARanjanARanjan 

Validation rule for certain profile

Hi I have written validation rule on opportunity.
I want this validation rule to trigger only for certain profile like "Regular User". Its not happening when I as a(Admin) edit opportunity and condition satisfy it gives me errror message too . Below is validation rule.

AND
(
AND
(ISCHANGED(StageName),OR( Subscription__c > 0, Services__c > 0),AND(Probability >=0.5, Probability <> 1), ISPICKVAL(Pre_Buy_or_NRE__c,'NO'), ISBLANK(Text(Mission_Critical__c))

),

OR
(
$Profile.Name <> "API Only User",$Profile.Name <> "Custom System Administrator",$Profile.Name <> "System Administrator",$Profile.Name <> "Configuration System Administrator"
)

)


Thanks,
Archana
ShashankShashank (Salesforce Developers) 
The profile names should be within an "AND" function and not an "OR" function. Please try as below:

AND
(
AND
(ISCHANGED(StageName),OR( Subscription__c > 0, Services__c > 0),AND(Probability >=0.5, Probability <> 1), ISPICKVAL(Pre_Buy_or_NRE__c,'NO'), ISBLANK(Text(Mission_Critical__c))

),

AND
(
$Profile.Name <> "API Only User",$Profile.Name <> "Custom System Administrator",$Profile.Name <> "System Administrator",$Profile.Name <> "Configuration System Administrator"
)

)
ARanjanARanjan
Thanks ! worked :)