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

  • 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 Apr 3 '17 at 11:33
  • No I am not converting a regular picklist to global picklist. – Vibhu Dadhichi Apr 3 '17 at 11:46
2

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>

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.