Weird issue when deploying object with updated picklist

908 views
Skip to first unread message

Phil W

unread,
Feb 8, 2018, 6:59:20 AM2/8/18
to Illuminated Cloud General Discussion
I have a custom object with a custom field that has the following XML definition:

<fields>
   
<fullName>ObjectType__c</fullName>
   
<externalId>false</externalId>
   
<inlineHelpText>Specifies the type of object from which the criterion selects objects to include in the group.</inlineHelpText>
   
<label>Object Type</label>
   
<required>true</required>
   
<trackTrending>false</trackTrending>
   
<type>Picklist</type>
   
<valueSet>
       
<restricted>true</restricted>
       
<valueSetDefinition>
           
<sorted>false</sorted>
           
<value>
               
<fullName>Contact</fullName>
               
<default>false</default>
               
<label>Contact</label>
           
</value>
           
<value>
               
<fullName>Site__c</fullName>
               
<default>false</default>
               
<label>Site</label>
           
</value>
           
<value>
               
<fullName>ProActiveContract__c</fullName>
               
<default>false</default>
               
<label>Contract</label>
           
</value>
           
<value>
               
<fullName>Job_Type__c</fullName>
               
<default>false</default>
               
<label>Job Type</label>
           
</value>
       
</valueSetDefinition>
   
</valueSet>
</fields>

First thing I noticed was the the label values were ignored when I originally deployed this to my dev org using IC (1.x at the time). I fixed the labels manually on my dev org and all was fine.

Now, however, I need to add two new entries in the picklist:

<fields>
   
<fullName>ObjectType__c</fullName>
   
<externalId>false</externalId>
   
<inlineHelpText>Specifies the type of object from which the criterion selects objects to include in the group.</inlineHelpText>
   
<label>Object Type</label>
   
<required>true</required>
   
<trackTrending>false</trackTrending>
   
<type>Picklist</type>
   
<valueSet>
       
<restricted>true</restricted>
       
<valueSetDefinition>
           
<sorted>false</sorted>
           
<value>
               
<fullName>Contact</fullName>
               
<default>false</default>
               
<label>Contact</label>
               
<description>Defines a base selection clause used directly and as the basis for inherited selections.</description>
           
</value>
           
<value>
               
<fullName>Site__c</fullName>
               
<default>false</default>
               
<label>Site</label>
               
<description>Defines a base selection clause used directly and as the basis for inherited selections.</description>
           
</value>
           
<value>
               
<fullName>ProActiveContract__c</fullName>
               
<default>false</default>
               
<label>Contract</label>
               
<description>Defines a base selection clause used directly and as the basis for inherited selections.</description>
           
</value>
           
<value>
               
<fullName>Job_Type__c</fullName>
               
<default>false</default>
               
<label>Job Type</label>
               
<description>Defines a base selection clause used directly and as the basis for inherited selections.</description>
           
</value>
           
<value>
               
<fullName>Booking_Requirement__c</fullName>
               
<default>false</default>
               
<label>Booking Requirement</label>
               
<description>The selection clause for this object type extends the inherited selections.</description>
           
</value>
           
<value>
               
<fullName>Shift__c</fullName>
               
<default>false</default>
               
<label>Shift</label>
               
<description>The selection clause for this object type extends the inherited selections.</description>
           
</value>
       
</valueSetDefinition>
   
</valueSet>
</fields>

When attempting to deploy I got the following error reported in the IDEA event log:

21:55 Deployment Failed
ERROR deploying CustomField objects/GroupCriterion__c.object: duplicate value found: <unknown> duplicates value on record with id: <unknown>
In the end I deleted/renamed the existing picklist values, deployed the updated custom object and then tidied up the cruft in the picklist. I noted that, again, the label didn't get correctly deployed (and the newly added description is ignored).

It seems to me that I shouldn't really see this issue and can only assume it was because I changed the labels on the dev org.

Anyone got any insights?

Phil

sc...@illuminatedcloud.com

unread,
Feb 8, 2018, 11:03:46 AM2/8/18
to Illuminated Cloud General Discussion
Phil, when I've seen this type of issue in the past I had to disable change tracking on the underlying field to get the changes through, then I was able to re-enable change tracking. Obviously such an opaque error could mean anything, but that's what it's (almost?) always been when I've hit it. I saw a discussion on this topic on one of the other forums (perhaps the GoodDaySir Slack channel) just the other day that seemed to reach the same conclusion.

Regards,
Scott

Phil W

unread,
Feb 8, 2018, 11:07:55 AM2/8/18
to Illuminated Cloud General Discussion
Hi Scott,

By change tracking do you mean "Track Field History" on the object? If so, I don't have this enabled. If something else, could you explain further?

Phil

sc...@illuminatedcloud.com

unread,
Feb 8, 2018, 11:19:07 AM2/8/18
to Illuminated Cloud General Discussion
Yep, and in particular I mean the following for a field in a .object file:

<trackHistory>true</trackHistory>

When I've seen that message it's almost always had to do with that field setting. I work around it by temporarily changing it to false, the next deploy goes through fine, and then I'm able to restore it. Here's one posting by Vivek C. on the topic that helped me:


Regards,
Scott

Phil W

unread,
Feb 8, 2018, 11:27:15 AM2/8/18
to Illuminated Cloud General Discussion
Scott,

Cheers. I independently spotted the "inactive value" issue mentioned - I saw this one a while back and resolved by deleting them (as per the article you cite). For this current issue I didn't have any inactives which is why I'm assuming the mismatch in label is the culprit. I'm not using history tracking on the field at all:

I can only assume there is a bug in the Salesforce-side of the deployment that causes the label to be ignored.

Phil

sc...@illuminatedcloud.com

unread,
Feb 8, 2018, 11:30:30 AM2/8/18
to Illuminated Cloud General Discussion
Yeah, in the aforementioned thread (which I can't seem to find now), I'm pretty sure this was confirmed to be a known issue, though no guidance was given on a resolution. There was just discussion about what it *really* means and how you can resolve it.

Phil W

unread,
Feb 9, 2018, 3:04:42 AM2/9/18
to Illuminated Cloud General Discussion
Looks like there is a bug in the deployment API for picklists - it fails to deploy the label and description but requires the original values' descriptions to be exactly as they are on the org. So if you add a description it breaks, or if you change the label on the org it breaks. Etc.
Reply all
Reply to author
Forward
0 new messages