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
BerlinGuyBerlinGuy 

Duplicating a dependent picklist to another object

We have an object that represents a deal, and it has dependent picklists of country and city. The country picklist contains about 40 countries, and the cities picklist contains about 5000 cities. The field dependency table is therefore pretty huge, and also contains repetitions (e.g.. A city pick value called "National" which is used in several different countries). The thing is that these dependent picklists would be useful for other objects and therefore we thought to create a "countryToCity" object with identical dependent picklists. However we wouldn't like to recreate the dependent picklists again manually, a process that will be very tedious and error prone.. Is there a way to automate the process? We could of course get the pick list values and load them to the country and city picklists of the new object - but how can we create the dependencies automatically?

 

Prafull G.Prafull G.

You can go with List type Custom Setting. See the example showing Country - State Example. You can implement same for the Country - City functionality.

Check the Link Custom Setting Methods and navigate below to the section "Country and State Code Custom Settings Example".

 

Hope it helps.

 

Regards,

crmtech21