Country/State Picklists
Enable Country/State Picklists
set Org/Company Language to English (so the Countries get created in English)
Setup → Company Settings → Company Information → Edit → Default Language
Setup → State and Country/Territory Picklists
click on Scan for Affected Data and Customizations → Scan for State and Country/Territory Data
convert any existing States, Countries and Territories
finish and Enable Picklists
revert Company Language back to the previous value
Use this tutorial for an in-depth guide: https://www.salesforceben.com/implementing-state-country-picklists-in-salesforce-a-tutorial/
Add States
Unfortunately, this needs to be done manually in the Salesforce Setup, one by one.
(Takes approx. 20 minutes)
“Integration Value” does not matter when creating the States and can be ignored.
The translation is deployable after the states have been created:
https://github.com/ANT-Informatik/Kaleido.Kontakte.NPC/blob/main/unpackaged/translations/standardValueSetTranslations/AddressStateCode-de.standardValueSetTranslation-meta.xml
sf project deploy start --source-dir unpackaged/translations/standardValueSetTranslationsAustria
State Name | State Code | Active & Visible | German Translation |
|---|---|---|---|
Burgenland | 1 | ✓ | Burgenland |
Carinthia | 2 | ✓ | Kärnten |
Lower Austria | 3 | ✓ | Niederösterreich |
Upper Austria | 4 | ✓ | Oberösterreich |
Salzburg | 5 | ✓ | Salzburg |
Styria | 6 | ✓ | Steiermark |
Tyrol | 7 | ✓ | Tirol |
Vorarlberg | 8 | ✓ | Vorarlberg |
Vienna | 9 | ✓ | Wien |
Switzerland
Please note: For the first column (which is supposed to be in English) we use the most current version of a canton name, also used by official publications. Most of the time it is the original name in the native language (DE/FR/IT). The only exceptions are Zurich and Geneva.
State Name | State Code | Active & Visible | German Translation |
|---|---|---|---|
Aargau | AG | ✓ | Aargau |
Appenzell Innerrhoden | AI | ✓ | Appenzell Innerrhoden |
Appenzell Ausserrhoden | AR | ✓ | Appenzell Ausserrhoden |
Bern | BE | ✓ | Bern |
Basel-Landschaft | BL | ✓ | Basel-Landschaft |
Basel-Stadt | BS | ✓ | Basel-Stadt |
Fribourg | FR | ✓ | Freiburg |
Geneva | GE | ✓ | Genf |
Glarus | GL | ✓ | Glarus |
Graubünden | GR | ✓ | Graubünden |
Jura | JU | ✓ | Jura |
Lucerne | LU | ✓ | Luzern |
Neuchâtel | NE | ✓ | Neuenburg |
Nidwalden | NW | ✓ | Nidwalden |
Obwalden | OW | ✓ | Obwalden |
St. Gallen | SG | ✓ | St. Gallen |
Schaffhausen | SH | ✓ | Schaffhausen |
Solothurn | SO | ✓ | Solothurn |
Schwyz | SZ | ✓ | Schwyz |
Thurgau | TG | ✓ | Thurgau |
Ticino | TI | ✓ | Tessin |
Uri | UR | ✓ | Uri |
Vaud | VD | ✓ | Waadt |
Valais | VS | ✓ | Wallis |
Zug | ZG | ✓ | Zug |
Zurich | ZH | ✓ | Zürich |
Germany
State Name | State Code | Active & Visible | German Translation |
|---|---|---|---|
Brandenburg | BB | ✓ | Brandenburg |
Berlin | BE | ✓ | Berlin |
Baden-Württemberg | BW | ✓ | Baden-Württemberg |
Bavaria | BY | ✓ | Bayern |
Bremen | HB | ✓ | Bremen |
Hesse | HE | ✓ | Hessen |
Hamburg | HH | ✓ | Hamburg |
Mecklenburg-Western Pomerania | MV | ✓ | Mecklenburg-Vorpommern |
Lower Saxony | NI | ✓ | Niedersachsen |
North Rhine-Westphalia | NW | ✓ | Nordrhein-Westfalen |
Rhineland-Palatinate | RP | ✓ | Rheinland-Pfalz |
Schleswig-Holstein | SH | ✓ | Schleswig-Holstein |
Saarland | SL | ✓ | Saarland |
Saxony | SN | ✓ | Sachsen |
Saxony-Anhalt | ST | ✓ | Sachsen-Anhalt |
Thuringia | TH | ✓ | Thüringen |
Reference
Sextant includes more countries than Salesforce, e.g. EU, Iran, Syria, North Korea, etc.
Sextant uses different names for some of the countries
Technical Information
settings\Address.settings-meta.xml
<countries>
<active>true</active>
<integrationValue>DE</integrationValue>
<isoCode>DE</isoCode>
<label>Germany</label>
<orgDefault>false</orgDefault>
<standard>true</standard>
<visible>true</visible>
</countries>General
adding/editing countries and states as part of a package or via metadata deployment is not really supported by Salesforce
countries/states cannot be added
editing is only possible to a very limited extent
see Scope of Metadata API in State/Country Picklist Customization
there are some workarounds
browser automation: https://www.youtube.com/watch?v=uA5IUSTmwSU
screen scraping the forms in Setup: https://github.com/mattandneil/statecodes
Fields
isoCodeis used in the CountryCode field (e.g. Account.BillingCountryCode)integrationValueis used in the Country field (e.g. Account.BillingCountry)default value is the value from
label
labelis a required field and cannot be changed (can only be changed manually in Setup)if needed, the display value can also be changed via the English translation
Problems
the only field that can be changed via package is
integrationValuein order to change the
integrationValuefield,Address.settings-meta.xmlneeds to be deployed as part of the packageas
labelcannot be changed, thelabelvalue inAddress.settings-meta.xmlhas to match thelabelvalue which is already present in the Orgif the Org was created in German, the
labelis also in German, which meansAddress.settings-meta.xmlcannot be deployed, aslabelcannot change
not sure what happens when Salesforce adds/changes countries
package deployment might fail if we don’t also update our Address.settings-meta.xml