AddressSettings

Represents the configuration of country/territory and state picklists. Use the AddressSettings component type to configure state and country/territory data in your organization so that you can convert text-based values into standard picklist values. To convert your state and country/territory values, from Setup, enter State and Country/Territory Picklists in the Quick Find box, then select State and Country/Territory Picklists.

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

Parent Type 

This type extends Metadata and inherits its fields.

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’s only one settings file for each settings component.

Version 

Introduced in API version 27.0.

Fields 

countriesAndStates 

CountriesAndStates Type 

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

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

Note

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

Note

Fields 

countries 

  • Type: Country[]
  • Required: No
  • Description: The countries and territories available in picklists.

Country Type 

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

Fields 

active 

  • Type: boolean
  • Required: Yes
  • Description: Determines whether the value is available in the API.

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

Important

integrationValue 

  • Type: string
  • Required: Yes
  • Description: A customizable text value that is linked to a state or country/territory code. Integration values for standard states, countries, and territories default to the full ISO-standard state, country, and territory 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/territory picklists to continue to work.

If you don’t specify integration values before enabling state and country/territory 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 

  • Type: string
  • Required: Yes
  • Description: The ISO-standard code populates this field when you issue a retrieve() call.

label 

  • Type: string
  • Required: Yes
  • Description: The label is what users see in picklists in Salesforce.

orgDefault 

  • Type: boolean
  • Required: Yes
  • Description: Sets a country or territory as the default value for new records in the Salesforce organization.

standard 

  • Type: boolean
  • Required: Yes
  • Description: Standard states and countries are states and countries that are included with Salesforce. You can’t edit the standard attribute.

states 

  • Type: State[]
  • Required: No
  • Description: The states or provinces that are part of the country or territory.

visible 

  • Type: boolean
  • Required: Yes
  • Description: Makes the state, country, or territory available to users in Salesforce. States, countries, or territories that are visible must also be active.

State Type 

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

Fields 

active 

  • Type: boolean
  • Required: Yes
  • Description: Determines whether the value is available in the API.

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

Important

integrationValue 

  • Type: string
  • Required: Yes
  • Description: A customizable text value that is linked to a state or country/territory code. Integration values for standard states, countries, and territories default to the full ISO-standard state, country, and territory 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/territory picklists to continue to work.

If you don’t specify integration values before enabling state and country/territory 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 

  • Type: string
  • Required: Yes
  • Description: The ISO-standard code populates this field when you issue a retrieve() call.

label 

  • Type: string
  • Required: Yes
  • Description: The label is what users see in picklists in Salesforce.

standard 

  • Type: boolean
  • Required: Yes
  • Description: Standard states and countries are states and countries that are included with Salesforce. You can’t edit the standard attribute.

visible 

  • Type: boolean
  • Required: Yes
  • Description: Makes the state, country, or territory available to users in Salesforce. States, countries, or territories 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 68.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>

Salesforce CLI Usage 

When working with the Salesforce CLI, use the metadata type Settings:Address to deploy or retrieve address settings.

Wildcard Support in the Manifest File 

The wildcard character * (asterisk) in the package.xml manifest file doesn’t apply to metadata types for feature settings. The wildcard applies only when retrieving all settings, not for an individual setting. For details, see Settings. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.