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
Phillip MoseleyPhillip Moseley 

How to add certain profiles to existing formula?

I have this formula now that is active, but I want it to work for only certain profiles and I'm having trouble adding the Profile ID's and getting it to work. Any Ideas?
Current Formula:
AND(
ISPICKVAL(Status, "Closed"),
ISBLANK(Resolution__c),
OR(
RecordTypeId = "01230000000n2BN",
RecordTypeId = "01230000000naxx"
),
NOT(
OR(
ISPICKVAL(Close_Reason__c, "Duplicate Incident"),
ISPICKVAL(Close_Reason__c, "FYI"),
ISPICKVAL(SelectSite_Modules__c, "Order Failure"),
IsSelfServiceOpened__c = true
)
)
)

____________________________________________________________________________________________________________________
Trying to ADD THIS BELOW into the formula and have it work. Right now, if I add this when I log in and I know my profile is listed below, the validation rule stops popping up.

OR(
Owner:User.ProfileId = "00ea0000001p1K2",
Owner:User.ProfileId = "00e30000001PsAN",
Owner:User.ProfileId = "00ea0000001p17H",
Owner:User.ProfileId = "00ea0000001p17I",
Owner:User.ProfileId = "00ea0000001orFY",
Owner:User.ProfileId = "00ea0000001p0o5",
Owner:User.ProfileId = "00ea0000001orNi",
Owner:User.ProfileId = "00ea0000001p0o0"
)
Carlos Campillo GallegoCarlos Campillo Gallego
Hi Phillip,

Are you sure you want to check the profile of the owner of the record? wouldn't be more useful to check the profile of the user performing the action?
Something like this:
AND(
	ISPICKVAL(Status, "Closed"),
	ISBLANK(Resolution__c),
	OR(
		RecordTypeId = "01230000000n2BN",
		RecordTypeId = "01230000000naxx"
	),
	NOT(
		OR(
			ISPICKVAL(Close_Reason__c, "Duplicate Incident"),
			ISPICKVAL(Close_Reason__c, "FYI"),
			ISPICKVAL(SelectSite_Modules__c, "Order Failure"),
			IsSelfServiceOpened__c = true
		)
	),
	OR(
		$User.ProfileId = "00ea0000001p1K2",
		$User.ProfileId = "00e30000001PsAN",
		$User.ProfileId = "00ea0000001p17H",
		$User.ProfileId = "00ea0000001p17I",
		$User.ProfileId = "00ea0000001orFY",
		$User.ProfileId = "00ea0000001p0o5",
		$User.ProfileId = "00ea0000001orNi",
		$User.ProfileId = "00ea0000001p0o0"
	)
)
Carlos Campillo GallegoCarlos Campillo Gallego
Oh! also keep in mind that those ids could be different in every sandbox of your org...

Regards
Phillip MoseleyPhillip Moseley
Carlos, Thanks for the help on this issue. It’s now working as it should. I will update the forum that this was the best answer! Thanks again. Phillip