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
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 :)