I have created a GlobalValueSet using salesforce metadata api. Now I am creating a new field on a existing object using SF metadata api which is going to use this GlobalValueSet, but somehow its failing to deploy giving me following error : Error: You must specify either picklist, globalPicklist, or valueSet.

Following is object field metadata and I tried using all the types ex: valueSet, globalPicklist, globalValueSet possible to get through this, but none works. Anyone has a idea how do we reference GlobalValueSets when creating a new picklist field ?

    <label>global time</label>
  • What version of the API are you using? – John Towers Mar 3 '17 at 17:01
  • using version 38.0 – nevrekar_amey Mar 3 '17 at 17:02

<valueSet> isn't just a value. It requires more. It should be:

    <description>Field description</description>
    <inlineHelpText>Helptext text.</inlineHelpText>
    <label>The field Label goes here</label>

This is how the field metadata is retrieved from the organization. You should use globalPicklist.

Information on how to describe the value set can be found here.

  • 2
    globalPicklist is only available in version 37.0 of the API. It has been replaced by valueSet. – John Towers Mar 3 '17 at 17:27
  • Thanks for pointing that. I extracted this snippet using the Force-CLI, which apparently was discontinued. :( Sad! – Renato Oliveira Mar 3 '17 at 17:34

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.