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 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’s 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/territories in picklists.
Field | Field Type | Description |
---|---|---|
countries | Country[] | The countries and territories available in picklists. |
Country
This metadata type provides the definition for a country/territory in a picklist.
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. |
integrationValue | string |
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.
|
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, 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 62.0.
<?xml version="1.0" encoding="UTF-8"?>
<AddressSettings xmlns="http://soap.sforce.com/2006/04/metadata">
<countriesAndStates>
<countries>
<country>
<active>true</active>
<integrationValue>United States</integrationValue>
<isoCode>US</isoCode>
<label>United States</label>
<orgDefault>true</orgDefault>
<standard>true</standard>
<states>
<state>
<active>true</active>
<integrationValue>Alabama</integrationValue>
<isoCode>AL</isoCode>
<label>Alabama</label>
<standard>true</standard>
<visible>true</visible>
</state>
<state>
<active>true</active>
<integrationValue>Alaska</integrationValue>
<isoCode>AK</isoCode>
<label>Alaska</label>
<standard>true</standard>
<visible>true</visible>
</state>
</states>
<visible>true</visible>
</country>
<country>
<active>true</active>
<integrationValue>Canada</integrationValue>
<isoCode>CA</isoCode>
<label>Canada</label>
<orgDefault>false</orgDefault>
<states>
<state>
<active>true</active>
<integrationValue>Alberta</integrationValue>
<isoCode>AB</isoCode>
<label>Alberta</label>
<standard>true</standard>
<visible>true</visible>
</state>
<state>
<active>true</active>
<integrationValue>British Columbia</integrationValue>
<isoCode>BC</isoCode>
<label>British Columbia</label>
<standard>true</standard>
<visible>true</visible>
</state>
</states>
<visible>true</visible>
</country>
<country>
<active>true</active>
<integrationValue>Greenland</integrationValue>
<isoCode>GL</isoCode>
<label>Greenland</label>
<standard>true</standard>
<visible>false</visible>
</country>
</countries>
</countriesAndStates>
</AddressSettings>
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.