1

I'm having problems understanding how to deploy Address.settings with the Metadata API. As in: how do I structure the package.xml?

I have this as Address.settings (shortened for brevity)

<?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>Andorra</label>
            <orgDefault>false</orgDefault>
            <standard>true</standard>
            <visible>true</visible>
        </countries>
        ....
        </countriesAndStates>
        </AddressSettings>

And this is the package.xml:

 <?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Address</members>
        <name>Settings</name>
    </types>
    <version>42.0</version>
</Package>

After zipping this up and deploying through the Metadata API in Workbench I get this error:

The object 'Address' of type Settings was included in the manifest file package.xml but the associated settings metadata is missing from the 'settings' folder

Can you see what is wrong with the package.xml in this case?

  • 1
    Is Address.settings inside a settings folder? – David Reed Oct 29 '18 at 16:41
0

This typically happens when your directory structure is incorrect. It should look like this:

src/
    package.xml
    settings/
        Address.settings

Your package.xml appears to be correct as written.

  • Excellent, knew it was just some minor niggle preventing this from working. Thanks! – akarnid Oct 30 '18 at 2:17
3

FYI: You can't create new state and country picklist values via Metadata API:

You can’t use the Metadata API to create or delete new states or countries.

https://developer.salesforce.com/docs/atlas.en-us.216.0.api_meta.meta/api_meta/meta_addresssettings.htm?search_text=AddressSettings

Real bummer, forcing you to manually create dozens of values via the web interface!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.