Custom Picklist

Hi all, In Picklist you can not have more than 1k entries. But I ran into a scenario where I wanted to show State, City and Pincodes as Picklist which were more than 1K. So the option was to create City a dependent picklist of State and a Pincode which is dependent of City. States were very less, but the cities count exceeded the limit of 1k entries and Pincodes were way higher. So went with the decision of making Custom Objects for state, city and pincode and manage dependencies with lookups. City will have lookup to State and Pincode will have lookup to City. But then came the problems of writting much code on the side of controller and as well as page to populate State,City and Pincode options in controller and then managing action support so that when state changes City needs to be also changed. So I thought why not to create a component which takes care of all issues. I have created a Picklist component which can show any lookup as picklists and also manages dependencies.

Features

1: You can use with fieldset and every lookup can be changed to picklist.

2: Picklist(sobject) dependencies can be maintained. In demo page only those contacts are shown which are under selected account.

3. Fast response because Js Remoting is used.

4. No need to write any extra apex code to populate options and action supports to manage picklist dependencies.

5. View state less.

DEMO PAGE

Here is the code for Custom Picklist Component

 

Here is the code for Custom Piklist Controller

Demo Page Code

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: