2

How can I restrict a picklist value to be shown for a profile without record type controlling?

1
  • Out of the box, using record types and page layouts is the way to go.
    – Eric
    Commented Sep 1, 2016 at 16:58

4 Answers 4

4

Having the same problem myself, I came to this via Google. The VF solution doesn't appeal because it only deals with one part of the UI - the original picklist will still be visible elsewhere.

Our proposed solution is to have "proxy picklists":

Put all the options in the original picklist e.g. Industry: {Aviation, Marine, Schools, Universities}

Then create a couple of extra "proxy" picklists:

Industry-Transport: {Aviation, Marine} Industry-Education: {Schools, Universities}

Add some simple Process Builder/Workflow/Trigger to copy changes in the proxies back to the original Industry picklist.

Then, use field-level permissions in the Profiles to make sure that Transport profile can see only Industry-Transport; and Education profile can only see Industry-Education.

1

Without using record types to control the values the only other option (without doing a lot of VF development etc.) would be to create validation rules to ensure that X profile cannot select values Y & Z.

1

With the new release Summer 17, you can set default values based on formulas. So if in your object you create a new picklist field to set as master for the rest of the picklist using field dependencies you will have to place the default value of that master picklist depening on the user profile.

In example, the new field is control with the values prof.1 , prof. 2, prof. 3 Then you make your existing picklist Industry, depending on the new picklist control So if user has profile 1 the values to be shown are Chemical, Pharmacy, Marketing If user has profile 2 the values to be shown are Textile and Retail If user has profile 3 the values to be shown are Hospitality, Restaurants

So that all was posible before summer.

Now the change is: When creating the new field control you can built a formula to define a default value like:

"CASE ( $User.USerProfile.Name,'Profile 1','Prof.1','Profile 2','Prof.2', 'Profile 3','Prof.3','')

Anytime a user tries to create the value on control picklist will be automatically populated based their correspondant profile and as the rest of picklist depends on that value you'll have the picklist restricted as you wanted.

I hope this helps!

0

If you want the functionality without using record types, you can create a VF component and embed it on your object's page layout and populate the picklist values based on profile in controller extension.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .