deploymentjenkinssalesforcemetadatapicklist

Deploying standard picklists via Metadata API


Have some trouble deploying leadSource and Industry picklists via Metadata API. Had to comment out both of them from the build. It may have something to do with these picklists being shared by multiple objects, I don't know. We are using Jenkins for the deployment. Here is a sample deployment error:

Error: objects/Lead.object(1150,13):An unexpected error occurred. Please include this ErrorId if you contact support: 1967816892-11483 (1554758315)

Solution

  • OK, we figured it out by trial and error, didn't see it documented anywhere.

    There are some standard picklists that are shared by multiple objects: "Lead Source", "Account Source", and "Industry".

    For example, "Lead Source" field is on Contact, CampaignMember, Lead, Opportunity, and Account. Although on Account it's named differently ("Account Source"), the picklist values are shared by all of these objects. To deploy this picklist, we need to make sure that we only list it on one of these objects, and comment it out from the others, otherwise we get a build error.

    Currently our build is set up as follows: 1) "Lead Source" field is deployed via "Account Source" field on the Account object, from where the picklist values are copied by Salesforce automatically to four other objects. 2) Industry field is deployed via Account object. It is commented out on the Lead object. From Account, SF automatically makes these picklist values available on the Lead.