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
Mayank_SareenMayank_Sareen 

Limit picklist values per profile

Hi all,

I am working on an assignment where i have multiple profiles for different users.I want a particular user to see only a subset of the picklist values.Can anyone help me achieve this.It would be of great help.

Thanks.
Best Answer chosen by Mayank_Sareen
Shubham NandwanaShubham Nandwana
Hi Mayank,
1. You can accomplish this (by profile) with Apex and Visualforce, but if you want to use native capabilities you can do this with RecordTypes. you can have different pick-list values based on recordTypes and then have different users assigned different recordTypes based on their profile.
https://developer.salesforce.com/docs/atlas.en-us.salesforce_recordtypes_cheatsheet.meta/salesforce_recordtypes_cheatsheet/recordtypes_cheatsheet.htm
https://help.salesforce.com/articleView?id=customize_recordtype.htm&type=5
2. Another method could be- set the default picklist value based on a hierarchy Custom Setting.
3. Deve'sc Sarilla's Validation Rule method is great if you don't mind the users seeing (and being able to errantly select the unacceptable options), but I don't think it's user-freindly to show options that will throw errors if selected/saved. So, I solved this same issue with the following approach:

     a. Copy original field "Picklist" for each profile, e.g. "Picklist_Standard_User", "Picklist_Contract_Manager", etc. 
     b. For each profile-specific picklist, only include options desired for that profile.
     c. Use Field Accessibility and/or Field-Level Security to control visibility and/or editability of each field.
     d. Build a process that updates the other corresponding picklists when any user updates their picklist.
 
So, for example, when Standard User updates "Picklist_Standard_User", the process updates "Picklist_Contract_Manager" to an option appropriate for that user.

Hope it helps, select it as best answer if it does the job.

Shubham Nandwana.
AppPerfect Corp.
salesforce@appperfect.com
408-252-4100
http://www.appperfect.com/services/salesforce/
Salesforce Development & Operations Experts

All Answers

devedeve
Hi Mayank,

Picklists can only be controlled by Record Types but not by Profiles, If you are using Record types, you can then configure what picklist options are visible for each record type.
If you are not using the Record Types, you can use Validation Rules to ensure Users with specific Profile can only select 2 out of the 5 values
Your Validation rule will look like below

AND(
$Profile.Id = "15 Digit Profile ID of User who can select 2 out of 5 values",
NOT(ISBLANK(TEXT(Picklist_Field__c))),
TEXT(Picklist_Field__c)<>"Option1",
TEXT(Picklist_Field__c)<>"Option2"
)
Shubham NandwanaShubham Nandwana
Hi Mayank,
1. You can accomplish this (by profile) with Apex and Visualforce, but if you want to use native capabilities you can do this with RecordTypes. you can have different pick-list values based on recordTypes and then have different users assigned different recordTypes based on their profile.
https://developer.salesforce.com/docs/atlas.en-us.salesforce_recordtypes_cheatsheet.meta/salesforce_recordtypes_cheatsheet/recordtypes_cheatsheet.htm
https://help.salesforce.com/articleView?id=customize_recordtype.htm&type=5
2. Another method could be- set the default picklist value based on a hierarchy Custom Setting.
3. Deve'sc Sarilla's Validation Rule method is great if you don't mind the users seeing (and being able to errantly select the unacceptable options), but I don't think it's user-freindly to show options that will throw errors if selected/saved. So, I solved this same issue with the following approach:

     a. Copy original field "Picklist" for each profile, e.g. "Picklist_Standard_User", "Picklist_Contract_Manager", etc. 
     b. For each profile-specific picklist, only include options desired for that profile.
     c. Use Field Accessibility and/or Field-Level Security to control visibility and/or editability of each field.
     d. Build a process that updates the other corresponding picklists when any user updates their picklist.
 
So, for example, when Standard User updates "Picklist_Standard_User", the process updates "Picklist_Contract_Manager" to an option appropriate for that user.

Hope it helps, select it as best answer if it does the job.

Shubham Nandwana.
AppPerfect Corp.
salesforce@appperfect.com
408-252-4100
http://www.appperfect.com/services/salesforce/
Salesforce Development & Operations Experts
This was selected as the best answer