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
Raymond AireyRaymond Airey 

Validation Rule - Exempt Profile from a Rule

My scenario is we have a field on an Opportunity which stops an opportunity being put against the wrong sale type 'Bookseller_Order__C'. We have discussed that a certain group of users need to be exempt from the validation rule that has been setup. I have tried a few different variations, the last one I had working and the profile needing exemption could change the oppotunity back and forth but other profiles has issues trying to delete products.
OR(
                AND(
                                ISPICKVAL(Bookseller_Order__c, "Yes"),
                                Non_Bookseller_Products__c <> 0
                ),
                
                AND(
                                ISPICKVAL(Bookseller_Order__c, "No"),
                                Bookseller_Products__c <> 0
                )
)

TL:DR - I need to exempt a profile from the above validation rule. Can anyone help?
Best Answer chosen by Raymond Airey
VineetKumarVineetKumar
Try this
AND(
	$Profile.Name <> "Profile Name",
	OR(
		AND(
			ISPICKVAL(Bookseller_Order__c, "Yes"),
			Non_Bookseller_Products__c <> 0
		),
		AND(
			ISPICKVAL(Bookseller_Order__c, "No"),
			Bookseller_Products__c <> 0
		)
	)
)