2

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
  • 1
    Is Address.settings inside a settings folder?
    – David Reed
    Commented Oct 29, 2018 at 16:41

2 Answers 2

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.

1
  • Excellent, knew it was just some minor niggle preventing this from working. Thanks!
    – akarnid
    Commented Oct 30, 2018 at 2:17
5

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!

1
  • 1
    +1 for relevant information... but a -1 for Salesforce because this answer stinks :[
    – jwatts1980
    Commented Sep 5, 2020 at 20:09

You must log in to answer this question.

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