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
PS81PS81 

Standard Picklist but with picklist value referencing to User object

Please may i ask for tips on how to enable a picklist of standard object or a custom field in standard object with dynamic picklist value? I want the values to be referenced to users object for specific profiles/roles only....

I'm aware we can create field dependency as lookup but giving it in picklist is waht the users are looking for and i dont wish to create a VF page overriding the standard.
Best Answer chosen by PS81
PS81PS81
Need to go with dynamic updates via api metadata

All Answers

Caleb SidelCaleb Sidel
For a picklist you have to custom code (see below), however custom relationships you create can have a filter so based on some information on the current record you can filter the result returned by the lookup. Not a picklist, but it might provide a workaround for you. You can expermiment with creating formula fields on the current record that reference $User and $Profile to try to then filter by the formula field.

An idea for how a VF page might work where you don't have to re-write the entire edit page: You'll have to create a VF page (or Lightning Component). If you create a VF page you could put the VF page into the standard page layout. This does cause one usability issue - on the detail page view you'll have your editable user lookup/picklist which you'll have to decide if it gets it's own edit/save mechanism (think about how you change the owner of a record, it's not on the edit page). And on the edit page view you will not see this VF page (i.e. field) at all. But on the view page it will look just like a field, only it will be a tiny VF page. Also you'll want the VF page to do a pop-up when you click the "change" or "edit" mechanism because otherwise the picklist will scroll out of view in the iframe which holds the VF page on the detail page - make sense?
PS81PS81
thkx caleb, vf page ma work but it would not suite the layout in the standard apps , here it is 'accouunt'. please can u throw some light on the other option u said
PS81PS81
Need to go with dynamic updates via api metadata
This was selected as the best answer