Loading

Retrieve Standard Countries and accompanying States/Territories via the Metadata API

Data pubblicazione: Oct 1, 2024
Descrizione

The Standard Countries list is provided in the article below:

Standard Countries and Territories for Address Picklists

However, this does not provide the states associated with each country.

We can use Metadata API to pull the Standard Countries list along with the states related to them.

 

Risoluzione

1) Create a sample package.xml as below :

<?xml version="1.0" encoding="UTF-8"?>
    <version>46.0</version>
    <types>
        <members>Address</members>
        <name>Settings</name>
    </types>
</Package>
 
2) Use the above package.xml in the Manifest file in the VS Code. Then right click on the Manifest file and select "SFDX: Retrieve Source in Manifest from Org"   
 
3) A new folder called "settings" is created under the force-app\main\default section.
 
4)  The file "Address.settings-meta.xml" under settings folder would display all the Countries and their accompanying state values in the VS Code as below :
 

 

Numero articolo Knowledge

002233551

 
Caricamento
Salesforce Help | Article