Newer Version Available

This content describes an older version of this product. View Latest

AddressSettings

Represents the configuration of country and state picklists. Use the AddressSettings component type to configure state and country data in your organization so that you can convert text-based values into standard picklist values. To convert your state and country values, from Setup, enter State and Country Picklists in the Quick Find box, then select State and Country Picklists . For more information, see “Let Users Select State and Country From Picklists” in the Salesforce online help.

This type extends the Metadata metadata type and inherits its fullName field.

In the package manifest, all organization settings metadata types are accessed using the “Settings” name. See Settings for more details.

Declarative Metadata File Suffix and Directory Location

AddressSettings values are stored in a single file named Address.settings in the settings directory. The .settings files are different from other named components because there is only one settings file for each settings component.

Version

AddressSettings is available in API versions 27.0 and later.

CountriesAndStates

This complex metadata type represents valid definitions of states and countries in picklists.

You can use the Metadata API to edit existing states and countries in state and country picklists. You can’t use the Metadata API to create or delete new states or countries.

Note

Field Field Type Description
countries Country[] The countries available in picklists.

Country

This metadata type provides the definition for a country in a picklist.

Field Field Type Description
active boolean Determines whether the value is available in the API.

After you enable state and country picklists in your Salesforce organization, you can’t set the active status to false.

Important

integrationValue string
A customizable text value that is linked to a state or country code. Integration values for standard states and countries default to the full ISO-standard state and country names. Integration values function similarly to the API names of custom fields and objects. Configuring integration values allows integrations that you set up before enabling state and country picklists to continue to work.

If you don’t specify integration values before enabling state and country picklists in your organization, records use the default value provided by Salesforce. If you change integration values later, records created or updated from that point on use your edited values.

Important

isoCode string The ISO-standard code populates this field when you issue a retrieve() call. This field is read only in the API but you can edit the label in Setup. You can’t edit the isoCode of standard states and countries.
label string The label is what users see in picklists in Salesforce. This field is read only in the API but you can edit the label in Setup.
orgDefault boolean Sets a country as the default value for new records in the Salesforce organization.
standard boolean Standard states and countries are states and countries that are included with Salesforce. You can’t edit the standard attribute.
states State[] The states or provinces that are part of the country.
visible boolean Makes the state or country available to users in Salesforce. States or countries that are visible must also be active.

State

This metadata type provides the definition for a state in a picklist.

Field Field Type Description
active boolean Determines whether the value is available in the API.

After you enable state and country picklists in your Salesforce organization, you can’t set the active status to false.

Important

integrationValue string
A customizable text value that is linked to a state or country code. Integration values for standard states and countries default to the full ISO-standard state and country names. Integration values function similarly to the API names of custom fields and objects. Configuring integration values allows integrations that you set up before enabling state and country picklists to continue to work.

If you don’t specify integration values before enabling state and country picklists in your organization, records use the default value provided by Salesforce. If you change integration values later, records created or updated from that point on use your edited values.

Important

isoCode string The ISO-standard code populates this field when you issue a retrieve() call. This field is read only in the API but you can edit the label in Setup.
label string The label is what users see in picklists in Salesforce. This field is read only in the API but you can edit the label in Setup.
standard boolean Standard states and countries are states and countries that are included with Salesforce. You can’t edit the standard attribute.
visible boolean Makes the state or country available to users in Salesforce. States or countries that are visible must also be active.

Declarative Metadata Sample Definition

The following is sample XML that configures state and country picklists for the United States and Canada for use in an organization. It also makes the country of Greenland available only in the API. This example is supported in API version 38.0.

1<?xml version="1.0" encoding="UTF-8"?>
2<AddressSettings xmlns="http://soap.sforce.com/2006/04/metadata">
3  <countriesAndStates>
4    <countries>
5      <country>
6        <active>true</active>
7        <integrationValue>United States</integrationValue>
8        <isoCode>US</isoCode>
9        <label>United States</label>
10        <orgDefault>true</orgDefault>
11        <standard>true</standard>
12        <states>
13          <state>
14            <active>true</active>
15            <integrationValue>Alabama</integrationValue>
16            <isoCode>AL</isoCode>
17            <label>Alabama</label>
18            <standard>true</standard>
19            <visible>true</visible>
20          </state>
21          <state>
22            <active>true</active>
23            <integrationValue>Alaska</integrationValue>
24            <isoCode>AK</isoCode>
25            <label>Alaska</label>
26            <standard>true</standard>
27            <visible>true</visible>
28          </state>
29        </states>
30        <visible>true</visible>
31      </country>
32      <country>
33        <active>true</active>
34        <integrationValue>Canada</integrationValue>
35        <isoCode>CA</isoCode>
36        <label>Canada</label>
37        <orgDefault>false</orgDefault>
38        <states>
39          <state>
40            <active>true</active>
41            <integrationValue>Alberta</integrationValue>
42            <isoCode>AB</isoCode>
43            <label>Alberta</label>
44             <standard>true</standard>
45             <visible>true</visible>
46          </state>
47          <state>
48            <active>true</active>
49            <integrationValue>British Columbia</integrationValue>
50            <isoCode>BC</isoCode>
51            <label>British Columbia</label>
52            <standard>true</standard>
53            <visible>true</visible>
54          </state>
55        </states>
56        <visible>true</visible>
57      </country>
58      <country>
59        <active>true</active>
60        <integrationValue>Greenland</integrationValue>
61        <isoCode>GL</isoCode>
62        <label>Greenland</label>
63        <standard>true</standard>
64        <visible>false</visible>
65      </country>
66    </countries>
67  </countriesAndStates>
68</AddressSettings>