[SalesForce] Ant Migration Tool – Not retrieving Task fields

I'm not able to retrieve any custom fields on the Task object. I'm able to get Contact custom fields fine. These fields are included in a managed package, but I don't understand why the Contact fields are coming over fine, but not the Task fields. Below is the task object and field reference in the build file.

Task
CustomObject

Task.Intervention_Task_Number__c
CustomField

After trying to manually add the fields to the build file, I recieve an error "Entity Enumeration Or ID: bad value for restricted picklist field: Task

Any ideas? Thanks

Best Answer

In the Setup UI you will see that custom fields (that are presented for Task) are added under the "Activities" heading and this is also reflected in the package.xml that the Ant tools use.

So your package.xml will need entries like these:

 <types>
    <members>Activity.Intervention_Task_Number__c</members>
    <members>Task.Subject</members>
    <name>CustomField</name>
</types>

where Activity is used for your custom fields and Task is used for standard fields such as Subject (whose picklist values you might want to customise).

Related Topic