Multi Dependent Picklists

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Implementing Multiple Dependent Pick-lists using Look Up Filters

The standard dependent picklist functionality in Salesforce, does not allow us to create dependent picklists of
more than one level. Here we would understand how to implement multi-picklist functionality using standard
Salesforce point and click customizations. This is a real time scenario implemented in one of my recent projects.

Business Scenario: We need to capture the address information of Leads/Contacts in the following manner:

 Street
 Town/City
 District(County)
 State/Province
 Country
 Pin Code/Zip Code.

The information provided to us is in an excel sheet with number of records exceeding over 150,000. The excel is in
the following format

Country State District(County) City/Town Street Zip Code


Country A State A District A Town A C1S1D1T1

Out of these, only Street would be ‘Text’. Rest all are supposed to be dependent picklists. So if a user selects
‘Country – A’ for example, the list of states should only show the states which are a part of ‘Country - A’. Similarly,
if a State is selected, the corresponding Districts (County), should only show the list of districts that are part of the
State so on and so forth.

Hence, if we drill down in order, by the time we reach Pin Code/Zip Code, we just have a single record. Also, as
mentioned earlier, we have over 150,000 unique records to insert.

Solution:

Since the standard Salesforce functionality poses a limit of just one dependent picklist, creating multi dependent
picklist is not possible. Also, since the number or records are huge, we would also like to add some kind of ‘Search’,
so that we can sort it out by putting in some keywords.

Step – 1: Create 4 custom objects – Country, State, District, Town, and Pin Code.

Object Name Primary Record Name Data Type


Country Country Name Text
State State name Text
District District Name Text
Town Town Name Text

Step – 2: Now we need to create custom fields within objects as follows:


Country

Field Name Type


N/A N/A

State

Field Name Type


Country Name Lookup(Country)

District

Field Name Type


State Name Lookup(State)

Town

Field Name Type


District Name Lookup(District)

Pin Code

Field Name Type


Town Name Lookup(Town)

Step – 3: Finally, since we need to capture the address information at Contact, Lead or Case detail page we need to
display them in their page layouts respectively. Here, I would just do for Leads.

Under the Leads objects create the following fields:

Field Name Type Filters


Country Name Lookup(Country) N/A
State Name Lookup(State) State: Country: Record ID EQUALS Lead: Country ID
District Name Lookup(District) District: State: Record ID EQUALS Lead: State ID
Town Name Lookup(Town) Town: District: Record ID EQUALS Lead: District ID
Pin Code Lookup(Pin Code) Pin Code: Town: Record ID EQUALS Lead: Town ID

Solution: The steps above not only resolve the issue by creating dependent Lookups which act similar to
dependent picklists, but also come with a standard search functionality, which could be used with large volumes of
data and provides a keyword search.

You might also like