How to exclude invalid fields that can’t be deployed by the Migration Tool from .object files when automating deployment?

I’m trying to add a level of automation to our development processes. My goal at the moment is to be able to automatically retrieve check-ins to our development feature release branch and then automatically deploy them into the QA Org for further testing. I’ve managed to get this all working with svn, the Migration Tool, and cruise control, but my main issue happens when including object definition files (e.g. Account.object) in the package when they have fields that can’t be deployed.

I want to get away from new fields having to be setup manually or managed through change sets. It would be great to be able to include the Account.object file in the deployment package when there’s been a new field added or modified so there doesn’t have to be manually editing of the object file each time.

The problem with this approach is that there are multiple fields included in the .object definition that the Migration Tool can’t/won’t deploy. I get these error trying to deploy just our Account.object file to another Org:

Error: objects/Account.object(10881,15):Cannot modify managed object: entity=Web
Link, component=00b30000001pBPs, field=Url, state=MANAGED_INSTALLED: newValue='h
ttps://{URL A}
&id={!Account.Id}', oldValue='{URL B}
Error: objects/Account.object(10906,15):encodingKey must be specified
Error: objects/Account.object(10926,15):encodingKey must be specified
Error: objects/Account.object(10944,15):encodingKey must be specified
Error: objects/Account.object(10962,15):encodingKey must be specified
Error: objects/Account.object(10981,15):encodingKey must be specified
Error: objects/Account.object(11001,15):encodingKey must be specified
Error: objects/Account.object(11012,15):encodingKey must be specified
Error: objects/Account.object(11022,15):encodingKey must be specified
Error: objects/Account.object(11032,15):encodingKey must be specified
Error: objects/Account.object(11042,15):encodingKey must be specified
Error: objects/Account.object(11052,15):encodingKey must be specified
Error: objects/Account.object(11070,15):encodingKey must be specified
Error: objects/Account.object(11088,15):encodingKey must be specified
Error: objects/Account.object(11106,15):encodingKey must be specified
Error: objects/Account.object(11124,15):encodingKey must be specified
Error: objects/Account.object(11142,15):encodingKey must be specified
Error: objects/Account.object(11166,15):encodingKey must be specified
Error: objects/Account.object(11200,15):encodingKey must be specified
Error: objects/Account.object(11231,15):encodingKey must be specified
Error: objects/Account.object(11255,15):encodingKey must be specified
Error: objects/Account.object(11287,15):encodingKey must be specified
Error: objects/Account.object(11354,15):encodingKey must be specified
Error: objects/Account.object(11417,15):encodingKey must be specified
Error: objects/Account.object(3984,13):Field Segment__c is a picklist field. Pic
klist fields are only supported in certain functions. <a href="javascript:openPo
_US&release=182.8.1&instance=CS3', 'Help', 1024, 768, 'width=1024,height=768,res
tion=yes,dependant=no', false, false);">Tell me more</a>

        at com.salesforce.ant.DeployTask.handleResponse(
        at com.salesforce.ant.SFDCMDAPIAntTaskRunner.runTask(SFDCMDAPIAntTaskRun
        at com.salesforce.ant.DeployTask.execute(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
        at java.lang.reflect.Method.invoke(

Total time: 25 seconds

So the first error appears to be because a managed field is different between the Development and QA Orgs (that’s fine but I’d like to exclude it), then there’s a shed load of “encoding key must be specified” errors, and finally a complaint about deploying a picklist definition.

So I’m wondering:

  1. How do I exclude invalid fields (e.g. managed / picklist) from the
    .object file to make the deployment work? (Unless there’s a way to
    deploy picklists?)
  2. What does the “encoding key must be specified” error mean?

Thanks for your help



Sense Check. If I have understood correctly you have reached a point where all your metadata and code for your solution is in SVN, nice! Then I assume you have developers deploying from that into orgs to perform development. Such as adding custom fields to Account and then downloading the Account.object file to commit back into SVN. Here you are finding additional information and metadata which is causing problems. If so maybe this will help to ensure only custom fields are committed in your Account.object files.

Downloading only Account Custom Fields via Eclipse. When your developing in your DE orgs you can open up the Project settings and under, use Project Contents to select only the custom fields for the Account object. This will result in a .object file with only custom fields in it. If your developers ensure they follow this practice, your deployment scripts should have less issues around this object.

enter image description here

As you can also see, only your custom WebLinks and ListViews can also be downloaded in the same way.

NOTE: The package.xml generated by Eclipse uses the CustomField metadata type to list the individual fields being added to account. This is not needed and would cause additional overhead for your developers to keep this in sync. Simply ensuring that the package.xml that gets used by your build scripts includes the Account.object file will be enough.

Hope this helps!

Source : Link , Question Author : Ray , Answer Author : Andrew Fawcett

Leave a Comment