Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to cut down on the number of profiles in one of my Orgs. One way we're using profiles is to enforce business rules, like "Only a ZZZ user may close opportunities as won," which we do by checking the Profile ID:

    <description>Only the system admin and ZZZ users
                 can update the stage to closed won</description>
                             AND(ISCHANGED(StageName), IsClosed=True, IsWon=True),
                             NOT(OR($User.ProfileId == '00eA0000000RhUw', 
                                    $User.ProfileId  == '00eA00000013Vro'))
    <errorMessage>You do not have the necessary access to mark an opportunity
                  &quot;Closed Won&quot; Please ask a ZZZ to do it for you.

For almost all other purposes, ZZZ users are identical to other users in their department, and I'd like to combine the profiles while making a permission set for ZZZ users. But I can't figure out what I'd do with validation rules like these. Is there a way to reference permissions/permission sets from formulas? If not, are there other approaches you've seen for this?

share|improve this question
up vote 2 down vote accepted

I believe such a problem can be solved at the profile level using the new custom Permissions feature and $Permission global variable that is available in Validation Rules/ VF Pages.

     AND(ISCHANGED(StageName), IsClosed=True, IsWon=True),

For more information on Custom Permissions.

share|improve this answer
I just want to bring this blog to your attention if you're using Customer Permissions, Validation Rules and triggers… – Jason Lawrence Apr 27 at 10:35

There is an open Idea to allow the usage of Users Permission Sets in Formulas, Validation Rules and Lookup Filters.

Alternatively, you could create a Field on the User object to store the permission set name. It could be comma separated for multiple permission sets on a single user. This field would then be used in the validation rule. Source idea from j020.

share|improve this answer

Found this article - hope it helps.

share|improve this answer
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review – Boris Bachovski Feb 4 at 22:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.