1

I would like to enable Field History Tracking for the Account, Opportunity, Contact and Lead objects.

I understand that I need to include the Setting's type in the Package.XML and I did so for the following objects.

<types> <members>Opportunity</members> <members>Account</members> <members>LeadConfig</members> <members>EnhancedNotes</members> <members>Chatter</members> <name>Settings</name> </types> 

I noticed when I pull down the metadata - it pulls down all object settings when I'm really just looking to just enable field history tracking.

So I went ahead and created separate object settings XML files. For example, this is for Account (+ contact).

<AccountSettings xmlns="http://soap.sforce.com/2006/04/metadata"> <enableAccountHistoryTracking>true</enableAccountHistoryTracking> <enableContactHistoryTracking>true</enableContactHistoryTracking> 

So my question is, if I'd doing this correctly, where do I need to put these individual object specific XML files so that the Package.XML can reference it? Hope this makes sense!

1 Answer 1

2

You will need to put this under settings folder and the file name would be Account.settings.

Where you will put this depends on whether you are using the source format for your project or the metadata format.

For Source format - it will be src/main/default/settings/Account.settings

and if you are using mdapi format it is src/settings/Account.settings and assumes src is your root folder and your package.xml is in same root folder as src

2
  • Thank you @Mohith Shrivastava - do you know if you could enable field history tracking for the individual fields within the Package.XML or in the individual config files? If yes, would love to know how or if you could point me to doc. I couldnt really find one, thus thinking this may need to be done via the API. As always I appreciate you and the community Commented Jan 12, 2023 at 22:47
  • Yes so for that you just need to put this in your object metadata and not the settings file. Every object also has a metadata you will extract that and that should have the field tracking info for various fields Commented Jan 13, 2023 at 2:22

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.