Loading
Salesforce から送信されるメールは、承認済ドメインからのみとなります続きを読む

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

公開日: Oct 1, 2024
説明

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.

 

解決策

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 :
 

 

ナレッジ記事番号

002233551

 
読み込み中
Salesforce Help | Article