Newer Version Available
AddressSettings
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.
| 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. |
| 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.
|
| 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.
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 42.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>