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
Darryl HanyDarryl Hany 

Create a dynamic picklist

Hi,

I am new to Salesforce so I appologize in advance if this does not make sense.

Situation.  I am trying to develop an app called Request that will have a number of picklist fields.  The possible values in these fields will be changing over time and I want my business units to have the capability to update the values themselves.  I do not want a developer to have to modify the fields for each change

Possible solution.  Create an object called Lookups. The record for this object will have a Key field and a Values field with multiple values.  The Request object has some kind of field/code combination that will search the Lookups object for a specific key value and present the Values field values in a picklist format.  The author selects the value wanted and the Request record field is updated.  This way I can set the security in the Lookups object so that some business people can maintain it and nobody will have to change the Request object.

Is this a sensible way to do this in Salesforce and, if so, how should I do it.

Thanks

Darryl
William TranWilliam Tran

Sure, if this is how you want drive it, it should work. 

Just create "Lookup" objects.  Tie these object to the main object that should have these lookups ( the main object is the child, the lookups are parents and the relationship is lookup (not master details).  Make sure the "lookup" fields are on the page layout.

Salesforce does the rest, when you go to the main object, you will see a magnifying glass for each look up where user can click and choose value.

The values is the list of records for the "lookup" objects.  You can control who can see and create these values.  

OWD shoud be public.

Profile object security is view for all, but create/edit/delete for the one who will maintain it.  If you don't want to create new profiles you can use permission sets.


As a common practice, if your question is answered, please choose 1 best answer. 
But you can give every answer a thumb up if that answer is helpful to you. 

Thanks

Darryl HanyDarryl Hany
Thanks William,

I tried that and it didn't work the way I wanted, but maybe I did something wrong.  For example.  I have a lookup object with two records:  one with a key of Department and values of IT, Finance, and HR, the other with a key of Project Lead with values of Tom, Fred, and Mary.  When I tried the Lookup field the field choices came out to be Department and Project Lead.  What I really wanted was to specify the key of Department and have the selection options be the values of that record.

What am I doing wrong?  I don't want to create an object for every picklist field in Requests.

Thanks
William TranWilliam Tran
You need to create an object for each lookup.  In your case, one object for Department Lookup and another for Project Lead Lookup.

Not very efficient but it's flexible and bypass admin maintainence.

Thx.