amtrack / force-dev-tool

[DEPRECATED] Command line tool supporting the Force.com development lifecycle
MIT License
108 stars 37 forks source link

handle standard picklist values #74

Closed amtrack closed 7 years ago

amtrack commented 8 years ago

Up to API version 37.0 standard picklist values are represented as CustomField metadata.

Starting with API version 38.0 some standard picklist values are being replaced by the StandardValueSet and StandardValueSetTranslation metadata type (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_standardvalueset.htm).

Unfortunately it seems that the standard fields can only be listed using the Metadata API for a single given CustomObject, so that multiple API calls would be necessary.

Further the components of StandardValueSet cannot be listed using the Tooling or Metadata API at all (yet, see https://success.salesforce.com/ideaView?id=0873A000000cMdrQAE).

We'll need to find a solution that works well with API version 38.0 and earlier.

92SGupta commented 5 years ago

@amtrack: could you please suggest the example package.xml which needs to be used for picking the standard picklist values? Do i need to define both CustomField and StandardValueSet in my package.xml to fetch both as below? I tried with just StandardValueSet as metadata name but it only fetches the AccountContactMultiRoles.standardValueSet. Please provide your views on this?

AccountContactMultiRoles
    <name>StandardValueSet</name>
AccountContactRelation.Roles
    <name>CustomField</name>
amtrack commented 5 years ago

@92SGupta

If you have an API version >= 38.0 in your package.xml, you should only have to list the StandardValueSet.

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