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
angusgrantangusgrant 

Country Picklist S-contol or apex/vf?

Hi can anyone provide code or/and advise of which is currently the best way to get a country picklist to replace the text field provided natively by sf.

 

Thanks for your help.

MVJMVJ

I would create a custom pick list field with all the country options you want to use.

 

Create a workflow rule that will update the standard Country field with the value from the pick list field when ever the record is updated.

 

This will use all native Salesforce.com functionality with out having to use apex.

 

HarmpieHarmpie

Check this : http://www.harmkorten.nl/salesforce/countriespicklist.zip

 

Countains a readme.txt with instructions, works great for me!

jademambrojademambro
Thanks for the great solution. My only concern is where we stuck the code. Is there a better place to put it?
HarmpieHarmpie

Unfortunately, this is the only place where you can put the solution like this. I agree it's not the most desirable place to put the code, but there's really no other way. If it's any consolation: Salesforce (Labs) published an app on the app Exchange (auto-complete), using this same approach.

 

By the way, I noticed some bugs in the script recently, where on the Account and Contact page, the country is not displayed correctly when re-editing a record (country IS saved correctly though). I will try to fix it and post an update asap :)

 

 

HarmpieHarmpie

Latest version can be found at:

http://salesforce.harmkorten.nl/2010/salesforce-country-fields-as-picklists/

 

 

Message Edited by Harmpie on 07-10-2009 01:14 AM
Message Edited by Harmpie on 07-10-2009 01:14 AM
Message Edited by Harmpie on 09-04-2009 03:54 AM