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
AAIAAI 

validation rule with profile role

Hi all,

I need to limit this validation rule to 2 profiles. I mean, this profiles won´t be able to modify the fields.

I attach the rule and I would appreciate any help`.

AND ( 

OR ($Profile.Name ="Manager Comercial-VGARC", $Profile.Name ="Manager Comercial"), 

NOT(ISNEW()),OR (ISCHANGED( Canal__c ),(ISCHANGED( LeadSource )) 

))
Best Answer chosen by AAI
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi ,

May I suggest you please refer the below link for reference. hope it helps

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar

All Answers

Rahul KumarRahul Kumar (Salesforce Developers) 
Hi ,

May I suggest you please refer the below link for reference. hope it helps

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar
This was selected as the best answer
Alain CabonAlain Cabon
Hi,

You have a problem for the ISNEW() probably. 
You can use ISBLANK in this case.

($Profile.Name ="Manager Comercial-VGARC" or $Profile.Name ="Manager Comercial"),
and either  (ISCHANGED(Canal__c) or ISCHANGED(LeadSource)  /* update */
            or  ISNEW() (creation) and either Canal__c or LeadSource is not blank.
AND ( 
  OR ($Profile.Name ="Manager Comercial-VGARC", $Profile.Name ="Manager Comercial"), 
  AND (
     OR ( 
        OR (ISCHANGED(Canal__c),ISCHANGED(LeadSource)),  /* update */
	    (ISNEW(),AND(OR( NOT(ISBLANK(Canal__c ), NOT(ISBLANK(LeadSource))))))
            /* creation */
     )
   )
)
Regards