Skip to main content
10 votes

Is it possible to test apex that relies on field history tracking?

Revive a nearly 5-year old question? Sure! Why not? This recently came up again in a question that I was working on answering, when that question was closed as a duplicate of this one. In addition ...
Derek F's user avatar
  • 62.5k
8 votes

What is the best workaround for the 20 field history tracking cap?

@sfdc's method will consume a lot of Data Storage -- and that's expensive! Do what @sfdc said but store the data in JSON in a Long Text Area Field on the record. Then build a Visualforce Page that ...
Scott Pelak's user avatar
  • 7,524
8 votes

How can you determine if an object has field tracking turned on?

You can querry FieldDefinition table in Salesforce which will tell you which fields have history tracking enabled for which object. eg. If I want to check what fields have history tracking enabled ...
Pranay Jaiswal's user avatar
7 votes

Move Lead History tracking section data to account on lead conversion?

As mentioned above, you cannot insert into the history tables of SF. You can create vf page that will show both history from the Lead History and the related Account. Create custom button in the ...
Liron C's user avatar
  • 1,788
7 votes
Accepted

What is the difference between trackHistory and trackFeedHistory?

trackFeedHistory Will track changes to the Object in the Chatter Feed for that object. This is called Feed Tracked Changes. These Feed Items are system generated and refered to as FTCs FTCs older ...
Paul B.'s user avatar
  • 401
6 votes
Accepted

How to Find History Tracking or Audit Log field in Custom object

You don't need Visualforce at all to display them in the Page Layout. You can look at the Related Lists for your object, search Hist... and you should see something like Account History. If you're ...
Adrian Larson's user avatar
  • 150k
5 votes
Accepted

Any reason not to check "Optional Features" when creating custom objects?

The reason you would de-select them is to make your custom object a Light Application Object, which could then allow you to use the Force.com App Subscription license type. Store Information That’s ...
Adrian Larson's user avatar
  • 150k
5 votes
Accepted

Tracking Address Changes - 10+ Years

With the help of Salesforce Shield you can track 60 fields per object and duration upto 10 years by default. Refer Field Audit Trail You would define the history retention of custom duration on a ...
Santanu Boral's user avatar
5 votes

Find record diff between two dates in Apex (to minimize API calls)

Field History Tracking is the most obvious choice, but comes with significant caveats: Several field types that can't be tracked: formula, roll-up summary, auto-number, created by, last mod by, AI ...
Thomas Taylor's user avatar
4 votes
Accepted

Field History Tracking - Finding value on a particular date?

You need the most recent history before or on the day you wish to examine. If none are found, you should fall back to the current value. You will need Apex post-processing something like: public ...
Adrian Larson's user avatar
  • 150k
4 votes
Accepted

Is it possible to write changes of Account ownerships into the Activity History?

Salesforce uses field history tracking exactly for this purpose: Go to Accounts => Fields Click on 'Set History Tracking' Enable Account History Check 'Account Owner' Make sure the Account History ...
Robin De Bondt's user avatar
4 votes
Accepted

How to know what are the limits for Shield history tracking in salesforce

You can track upto 60 fields per object and it should be same for all sandboxes. Please check below info https://www.salesforce.com/blog/2015/07/introducing-salesforce-shield.html Field Audit Trail ...
sfdc's user avatar
  • 13.7k
4 votes
Accepted

can i extract all sent email information from marketing cloud

You will need to use Tracking Extracts. It will need to be done in chunks of 30-90 day increments though. (30 days in Automation studio for custom range, 90 days in Email Studio - if you still have ...
Gortonington's user avatar
  • 30.7k
4 votes
Accepted

How to track Account Description field changes in Field history Tracking?

The "Track Changes" fields (basically, anything that's a LTA) is a limitation of the platform; it can only track changes for fields of 255 characters or less. In the UI, the changes would be listed as ...
sfdcfox's user avatar
  • 495k
4 votes
Accepted

What are the requirements to receive Tracking Data from Journey Builder in Salesforce?

If you're sending emails fro Journey Builder, you need to check the "Send Tracking Results to Sales Cloud" checkbox, regardless whether you are using Sales Cloud Data or a data extension as the entry ...
zuzannamj's user avatar
  • 14.4k
4 votes
Accepted

Illegal assigment from Object to String

I think history tracking object's oldvalue field return datatype is an object, Therefore it is returning object as a value. What you can do is, you can convert/typecast the object to a string or any ...
Bilal Malik's user avatar
3 votes
Accepted

History tracking for Formula fields

You can use following options: Enable History tracking on fields which are used in the formula calculation. Based on these fields, you can easily estimate what the value of the formula field would be ...
RajeshShah's user avatar
  • 1,754
3 votes

Check Via API If Field History Tracking Is Enabled?

If you just want to check if the history tracking is on or off for an object (and don't need to check which fields), you can rely on the naming pattern of the SObject used to track the history. For ...
Keith C's user avatar
  • 136k
3 votes
Accepted

Set history tracking on contact object details page

You need to Enable History Tracking option on Contact. Set the fields whom you need to track histories. Go to the Page Layout in Edit mode, select the Related listsand from there select Contact ...
Santanu Boral's user avatar
3 votes

Is it possible to filter off Old Value or New Value in a history report ?

There is currently no way to filter on Old Value/New Value. But I really like this idea. Here is what Salesforce is proposing you : Currently, there is no ability to filter on the Old Value or New ...
brovasi's user avatar
  • 5,685
3 votes

Track report usage and report export

The EventType to monitor report is ReportExport. You can try below query, /services/data/v32.0/query?q=SELECT+Id+,+EventType+,+LogDate+,+LogFileLength+,+LogFile+FROM+EventLogFile+WHERE+EventType+=+'...
Devendra's user avatar
  • 5,075
3 votes

Is it possible to test apex that relies on field history tracking?

It now seems that you can insert EntityHistory objects during testing, although you cannot write the old and new values. I have not found documentation that says you can so maybe it came along by ...
Eric's user avatar
  • 54.2k
3 votes
Accepted

WHERE clause in SOQL query to history object (to custom field)

You need to wrap the value in single quotes ('...'): SELECT Field, OldValue, NewValue FROM MyObject__History WHERE Field = 'Custom_Field__c'
Adrian Larson's user avatar
  • 150k
3 votes
Accepted

Salesforce history log

Does anyone know if Salesforce keeps a history log of record changes and is able to provide that for a fee? They can provide a log of records that were changed via Historical Event Logs, but that ...
sfdcfox's user avatar
  • 495k
3 votes

What cannot be tracked in Setup Audit Trail?

Monitor Setup Changes explains what is tracked. If it's not on this list, it's not tracked in the Setup Audit Trail. If you need other types of tracking, you might want/need Event Monitoring. This is ...
sfdcfox's user avatar
  • 495k
3 votes
Accepted

Tracking History of changes in Custom fields of custom objects

So as confirmed in comments you need to add the related list to page layout. The name will be something like "ObjectName History Related List".
Tushar Sharma's user avatar
3 votes

Can I turn off read access to field history for some users?

Note that users won't see field changes in the Case History related list for fields that they don't have at least read FLS access to. That said, there's no way to do this completely. The best you can ...
Thomas Taylor's user avatar
3 votes
Accepted

Opportunity historical trending: I miss many fields

The reason why you can't select Age and Stage Duration is that they are in essence, formula fields and per the doc on Historical Trending Limitations, formula fields aren't supported The deeper reason ...
cropredy's user avatar
  • 72k
2 votes

What is the best workaround for the 20 field history tracking cap?

Here is a Trigger + handlerclass version I've implemented account team history tracking using a similar to the method above. I have a custom object Account_Team_Member_History__c. The standard name ...
Havoc's user avatar
  • 76
2 votes
Accepted

How to get lastmodifiedby field on history of custom object

Following up on sfdcfox's answer, if you want the person who made the last change to a field foo__c on some sobject instance: select createdById, oldvalue, newvalue from Class__History ...
cropredy's user avatar
  • 72k

Only top scored, non community-wiki answers of a minimum length are eligible