0

I need to do Field History Tracking on BillingCountryCode and BillingPostalCode on Account. I only can chose the field BillingAddress in the Tracking setup. But whereas BillingCountryCode and BillingPostalCode are filled in my data (they are set in Apex code mostly), the compound field BillingAddress is not. So it seems that if there is a change in Country or PostalCode, the field BillingAddress is not affected.

So this query gives me results for BillingPostalCode and BillingCountryCode, but BillingAddress is not filled in any Account:

Select BillingPostalCode, BillingCountryCode, BillingAddress from Account

When I turn on Field History Tracking, and I query this:

SELECT AccountId,Field,Id,NewValue,OldValue FROM AccountHistory

the changed fields "BillingPostalCode" and "BillingCountryCode" show in the AccountHistoryTable, but without a OldValue and also without a NewValue.

2 Answers 2

0

Billing Address is a compound read-only field and can be populated. Any changes to the fields compounded by Billing Address do get captured in history tracking.

  • Changing the country also changes the country code and that gets captured.
  • Changing the country code from Apex also changes Country and State is the state does not fall in that country.

If the field values are not visible on the UI, try an run a query to confirm that the fields are correct and also that the Billing Address field on UI is the correct one.

History

1
  • '@manjit5190: So when I turn on Field History Tracking, change both BillingPostalCode and BillingCountryCode and then query like this: "SELECT AccountId,Field,NewValue,OldValue FROM AccountHistory where AccountId = 'xxx' order by Field" both OldValue and NewValue are not filled. When I query this: "Select BillingPostalCode, BillingCountryCode, BillingAddress from Account" then I see values for both BillingPostalCode and BillingCountryCode, but not fro BillingAddress... May 3, 2020 at 10:47
0

I found out that when I query in Workbench the compound field BillingAddress is null, and also OldValue and NewValue. When I query in the Developer Console query editor it is not. It appears it has something to do with Salesforce internally dealing with BillingAddress as an Object of the class Address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .