Search
Twitter
« Salesforce Tooling API | Main | Avoiding Data Skew Situations »
Tuesday
Jan222013

Configuring State & Country Picklists

in Salesforce Spring ‘13

Well, Salesforce finally did it. They’ve introduced State and Country picklists to their 2013 Spring release. Phew! No more messy (and often erroneous) text-entry fields. These picklists will allow you to choose a state and country based on a selection in a dropdown menu.

Hold onto your party hats though because it’s not as easy to implement as you might think. You’ll need to do a little behind-the-scenes work to configure state and country picklists so that they work in your organization.

First things first. You’ll need to configure the picklists in the Metadata API and then scan your organization to see where text-based state and country data is used. Next you’ll convert your existing data and fix the existing customizations so that they play nice with the new, standardized values. Finally, you can enable the lists for your users.

The State and Country Picklists page in the Data Management area of Setup is where you’ll spend most of your time preparing your organization to use the picklists. Thankfully, the process is outlined and most of the steps can be executed right there. You can also click “Help for this Page” to get the full documentation for the feature.

The most obvious step for administrators is configuring the picklists in the Metadata API. Using the Force.com IDE, you’ll need to edit the AddressSettings metadata component, which is new in Metadata API 27.0. AddressSettings allows you to control which picklist values appear in the Salesforce UI and how to map existing, text-based state and country values to new the picklist values, making the convert process using the address conversion tool in Setup a breeze. The AddressSettings component has four fields for each state and country you enable, and it will look pretty similar to this abbreviated example when you’ve configured them:

01

<?xml version="1.0" encoding="UTF-8"?>

02

<AddressSettings xmlns="http://soap.sforce.com/2006/04/metadata">

03

<countriesAndStates>

04

<countries>

05

<active>true</active>

06

<integrationValue>United States</integrationValue>

07

<isoCode>US</isoCode>

08

<label>United States</label>

09

<states>

10

<active>true</active>

11

<integrationValue>Alaska</integrationValue>

12

<isoCode>AK</isoCode>

13

<label>Alaska</label>

14

</states>

15

</countries>

16


17

<countries>

18

<active>true</active>

19

<integrationValue>Canada</integrationValue>

20

<isoCode>CA</isoCode>

21

<label>Canada</label>

22

<states>

23

<active>true</active>

24

<integrationValue>Alberta</integrationValue>

25

<isoCode>AB</isoCode>

26

<label>Alberta</label>

27

</states>

28

</countries>

29

</countriesAndStates>

30

</AddressSettings>

 

Have fun with the new picklists feature and check back with us for more news soon!

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (1)

Hi. I'd love some more information around this. I've tried using the Workbench to enable the AddressSettings but am not having any luck. I tried using Eclipse but the version 27.0 plugin is not available yet. In the workbench I am including 2 files - package.xml and address (the settings metadata in a settings folder). I am receiving an error which indicates that the adress settings file is not found in the settings folder. Should I be giving the settings file a specific name? I have tried address, address.settings and addresssettings. Thanks for your help.

February 11, 2013 | Unregistered CommenterShilpa

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.