10

In order to implement Country Picklists on standard address fields I'm following the documentation here:

https://help.salesforce.com/HTViewHelpDoc?id=admin_state_country_picklists_overview.htm&language=en

I'm trying the next things in advance when this feature is still OFF. I'm aware that after it's ON some settings are more restrictive.

Now here it's said:

If you’re editing many state and country picklist integration values, using the Metadata API is more efficient than editing values in Setup.

which is painfully true... The standard setup UI makes it a huge trip to mass update with bizillions of clicks required. So I thought using eclipse could ease that pain. Unfortunately I was not able to save this file to the any org (tried Sandbox, DE, Production). Neither Force.com > Save to Server nor Force.com > Deploy to Server worked.

In the link mentioned above, it says

You can use the Metadata API to edit existing states and countries in state and country picklists. You can’t use the Metadata API to create or delete new states or countries.

Sad that create doesn't work, but edit should be OK.

But if I rename the label of AD from "Andorra" to "Andora1" like this (watch the label-tag)

<?xml version="1.0" encoding="UTF-8"?>
<AddressSettings xmlns="http://soap.sforce.com/2006/04/metadata">
    <countriesAndStates>
        <countries>
            <active>true</active>
            <integrationValue>Andorra</integrationValue>
            <isoCode>AD</isoCode>
            <label>Andorra1</label>
            <orgDefault>false</orgDefault>
            <standard>true</standard>
            <visible>true</visible>
        </countries>
        <!-- here comes the rest of the default file unchanged ... -->
     </countriesAndStates>
</AddressSettings>

it fails and I'll get only

Save error: Cannot modify label for country Andorra with iso code AD to Andorra1
Address.settings
/[email protected]/src/settings line 0  Force.com save problem

However changing the integrationValue like this DOES work (watch the integrationValue-tag):

<?xml version="1.0" encoding="UTF-8"?>
<AddressSettings xmlns="http://soap.sforce.com/2006/04/metadata">
    <countriesAndStates>
        <countries>
            <active>true</active>
            <integrationValue>Andorra1</integrationValue>
            <isoCode>AD</isoCode>
            <label>Andorra</label>
            <orgDefault>false</orgDefault>
            <standard>true</standard>
            <visible>true</visible>
        </countries>
        <!-- here comes the rest of the default file unchanged ... -->
     </countriesAndStates>
</AddressSettings>

Has anyone saved this Metadata successfully without using the setup UI? If so, how?

Why could a Massupdate become necessary?

It's mostly an I18n issue: If an Org is spun non-EN (say it's spun DE), all Master Picklist Values are set in DE. This is also true for Countries and States. So it's "Ägypten" instead of "Egypt" and "Österreich" instead of "Austria".

Now if you set the orgs default language to EN and plan to make all the implementation in EN and run later the translation workbench, you stick with shitty values for all Picklist with NO CHANCE to change it (onless you creep through the UI).

It looks like this:

enter image description here

We are ISV and SI partners. We have enterprise clients with international teams. Centering around DE is quite bad idea and making the implementation in EN makes much more sense. Usually the Salesforce Account Executive asks the client to start a trial which will be converted into a permanent Org later. All those Orgs spin in DE... Now if we say: please kill the org an provide a new one, it sucks, too. Often it's not possible anymore if the client has already started to work with something and killing the Org is not an option.

Picking the right spin-up language can't be controlled by the client but it's a crucial decision. So it's sure as hell that you can't prevent DE in all cases. This is something which happens frequently and can't be helped.

Even worse for Developer Orgs. We spin them at the environment hub. There is no spin-language selector. All of them spin in DE. I had long sessions with the support and they couldn't fix this permanently.

So changing many Master Picklist Values fast (ideally without UI but in code) would help a lot.

1 Answer 1

7

I'm one of the developers who worked on this feature. You're not missing anything. Currently, the setup UI is the only way to change the display labels of states and countries.

While SCP is off, you should be able to edit the 'active', 'visible', 'integration value', and 'orgDefault' properties of states and countries via AddressSettings in MD API.

The only additional limitation after the feature is on is that you cannot set the 'active' property from true to false. You can still set it from false to true.

(more doc: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_addresssettings.htm)

6
  • Thanks Carolyn, I was doubting into myself while trying. For me this is hard to understand how someone could possibly design such an important feature without good way to mass-edit. You might think why the hell need I to change all labels? It's because of an bug that on orgs spun up in german the translation is wrong. The labels come up as german in the English language. I need to fix all of them. Bloody work ahead. Need to repeat it on other orgs. As I understand you, the labels can't be easily copied from org to org, right? If so, this feature comes with serious pains...
    – Uwe Heim
    Jun 3, 2015 at 6:35
  • I hear you. The gap is on the team's radar (safe harbor). I'm not sure what you mean by "the labels come up as german in the English language," though. Can you tell me more? Is it a problem when the org language is different than the signup language? Jun 3, 2015 at 15:15
  • I will add a screenshot for the translation issue to see that clear.
    – Uwe Heim
    Jun 3, 2015 at 15:35
  • Screenshot is present now. Also added a longer description to explain the backgrounds. Ideas or Workarounds are welcome, too.
    – Uwe Heim
    Jun 3, 2015 at 16:12
  • Once you're at the point of setting up SCP, the best workaround would be to use the Translation Workbench to update the display values after the feature is turned on. Jun 4, 2015 at 18:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .