I am using visual studio code to retrieve source from the org and then deploying changes in ant using the package.xml. Is there a way to grab the history field tragging flag for the standard field "owner" on my custom object? Owner doesn't seem to be listed as a field on the object..


OwnerId is a system field that is not retrievable by the metadata API.

However you can still deploy the history tracking property. In your custom object xml file, just add the following:

  • Would that be the {custom object name}.object-meta.xml file? Can I place it anywhere? How would I deploy that in the package.xml after? – JJ Sunga Jun 11 '20 at 14:47
  • Yes. You can see the sample xml file here: developer.salesforce.com/docs/atlas.en-us.api_meta.meta/… How to deploy your metadata using workbench: help.salesforce.com/… – Hengky Ilawan Jun 11 '20 at 15:01
  • Sorry, my previous comment has an incorrect info. If your custom object xml file is in the format of {custom object name}.object-meta.xml, that means it is sfdx format, you need to convert it to metadata api format first then you can deploy it using mdapi (eg; using workbench). – Hengky Ilawan Jun 11 '20 at 15:16
  • is there a way to deploy that through the metadata api. How we handle it is that we currently only deploy through the metadata api using jenkins – JJ Sunga Jun 11 '20 at 15:24
  • You are diverging from your original question. Anyway, using Jenkins or any tool, if you use mdapi, you need to follow the mdapi format. – Hengky Ilawan Jun 11 '20 at 16:15

When two objects are in the master-detail relationship field, You will not have owner field on child object i.e. detail side of the relationship. The owner of the master record will be the owner of the child records. This is the reason Owner doesn't seem to be listed as a field on the object.

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.