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
AbAb 

restricting values of picklist to certain users belonging to same profile but without modifying in record types

Hello,

I have object "account" which have 5 record types, there are around 10 profiles in my org.
For object "account" there are few picklist.

For one of the profile, presently 5 pricklist are available out of 8.
For certain users of this profile i want only 3 prickist to be avaiable.

How can i i acieve my usecase ?
thanks for suggestion!
 
Best Answer chosen by Ab
Akhil AnilAkhil Anil
Hi Sandrine,

I would say that the best way to tackle this scenario is by using a simple validation rule. That's it. The rule will not allow the user to select and save the picklist values which they are not supposed to. The formula for this validation rule would be simply this.
 
AND(
CASE($User.Username,
"Username 1 here",1,
"Username 2 here",1,
"Username 3 here",1,
"Username 4 here",1,
0) = 1,
CASE(Picklistfield__c,
"Value 1",1,
"Value 2",1,
"Value 3",1,
0) = 0
​)

In the above formula, just replace the Values with the allowed values that the user is intended to select and replace the usernames with the users whom you want to restrict only 3 values. 

That should work !

Kindly mark it as an answer if that resolved your query.

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Sandrine,

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.

May I also suggest you please refer with below approaches.
  • 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.
  • 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.

Best Regards,
Nagendra.
Akhil AnilAkhil Anil
Hi Sandrine,

I would say that the best way to tackle this scenario is by using a simple validation rule. That's it. The rule will not allow the user to select and save the picklist values which they are not supposed to. The formula for this validation rule would be simply this.
 
AND(
CASE($User.Username,
"Username 1 here",1,
"Username 2 here",1,
"Username 3 here",1,
"Username 4 here",1,
0) = 1,
CASE(Picklistfield__c,
"Value 1",1,
"Value 2",1,
"Value 3",1,
0) = 0
​)

In the above formula, just replace the Values with the allowed values that the user is intended to select and replace the usernames with the users whom you want to restrict only 3 values. 

That should work !

Kindly mark it as an answer if that resolved your query.
This was selected as the best answer