3

While deploying using Jenkins I get the error:

Error: Cannot change which global value set this picklist uses

I have made a global picklist which has three values out of which one is default.

<?xml version="1.0" encoding="UTF-8"?>
<GlobalPicklist xmlns="http://soap.sforce.com/2006/04/metadata">
    <globalPicklistValues>
        <fullName>Planned</fullName>
        <default>false</default>
    </globalPicklistValues>
    <globalPicklistValues>
        <fullName>Done</fullName>
        <default>true</default>
    </globalPicklistValues>
    <globalPicklistValues>
        <fullName>Cancelled</fullName>
        <default>false</default>
    </globalPicklistValues>
    <masterLabel>Call Status</masterLabel>
    <sorted>false</sorted>
</GlobalPicklist>

I am using that global picklist in an object field.

    <fields>
        <fullName>Status_MDE__c</fullName>
        <description>If a call is planned with a future date, the status is set to &quot;Planned&quot; automatically.
If a call is created with todays date or older, the status is set to &quot;Done&quot; automatically</description>
        <externalId>false</externalId>
        <globalPicklist>CallStatus_MDE</globalPicklist>
        <label>Status</label>
        <required>false</required>
        <trackFeedHistory>false</trackFeedHistory>
        <trackHistory>false</trackHistory>
        <trackTrending>false</trackTrending>
        <type>Picklist</type>
    </fields>

Now when I pull data from Mavensmate the global picklist values are defined in the recordTypes of the object which causes this error.

 <recordTypes>
    <fullName>Regular_Calls</fullName>
    <active>true</active>
    <label>Regular Calls</label>
    <picklistValues>
        <picklist>CallStatus_MDE</picklist>
        <values>
            <fullName>Cancelled</fullName>
            <default>false</default>
        </values>
        <values>
            <fullName>Done</fullName>
            <default>false</default>
        </values>
        <values>
            <fullName>Planned</fullName>
            <default>false</default>
        </values>
    </picklistValues>
</recordTypes>

I tried the idea mentioned here - https://success.salesforce.com/ideaView?id=08730000000cJegAAE

2
  • Are you trying to convert existing field from regular picklist to global picklist? If so, you cannot. Try create new field as global picklist, copy data from the old field to new field, change all references to the new field, and at end delete the old (refular picklist).
    – Liron C
    Commented Apr 3, 2017 at 11:33
  • No I am not converting a regular picklist to global picklist. Commented Apr 3, 2017 at 11:46

1 Answer 1

3

I don't know how and why but when I changed the global picklist API name to match the field name. It worked!

<fields>
        **<fullName>CallStatus_MDE__c</fullName>**
        <externalId>false</externalId>
        **<globalPicklist>CallStatus_MDE</globalPicklist>**
        <label>Status</label>
        <required>false</required>
        <trackFeedHistory>false</trackFeedHistory>
        <trackHistory>false</trackHistory>
        <trackTrending>false</trackTrending>
        <type>Picklist</type>
    </fields>
2
  • Pretty valid! Mark it as an answer :) Commented Oct 20, 2017 at 14:31
  • Copado has a help article about this "issue" as well: docs.copado.com/article/… - This is a Salesforce limitation regarding global picklists fields. The conversion of an existing field from regular to global picklist is not allowed by Salesforce. You will need to manually convert the field in the target org. Commented May 13, 2021 at 11:19

You must log in to answer this question.

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