The next to auditing technique that we are going to talk about is field history tracking.
So what does this feel history tracking seed history tracking as the name says it is a tracking the
history of a particular field meaning tracking the changes that happens in a particular field and tracking
all the data behind that that is called That's field history tracking tracking that changes of a particular
field.
And this field history data that we capture is retained for up to 18 months through the ARD 24 months
through the API and thus feel history tracking.
We can set it up mode for custom objects and for standard objects.
No let's hop over a developer edition and understand how to configure this feature off field history
tracking first lets go for any custom object that we created we already created a handful of custom
objects while we were learning about custom objects and relationships.
So pick any one off the custom object in our case.
Let me go for courses and go to the object definition page so view object.
So this the object definition page of The Course is custom object for our field history for enabling
a field history.
This particular option of track field history should be enabled and here in custom fields and relationships.
We do not see any button then this feature is enabled.
We will see a button that says set history tracking and now that this feature is not enabled.
We did not see that button.
So let me go ahead
and enable track field history
so checking the checkbox for this track field history option it enables us to track field history for
the objects defined in this particular Custom Object closest and here as I mentioned earlier ones you
enable that automatically you see a button under custom fields and relationships.
So click on that button here you need to select which are all in the fields that we would like to track.
Now when we need to choose the fields that we would like to track we need to question ourselves.
Two things.
One is how many fields can we track at a maximum.
Next us can all field types be tracked right.
We need to ask ourselves these two to answer the first question how many fields can be tracked per object
up to 20 fields can be tracked per object and if you want more than 20 fields to be tracked then we
need to contact Salesforce customer support.
But in that case when we contact Salesforce up customer support and increase the number of fields that
are tracked more than 20 it may affect the data saving time we need to make note of it and the second
question that we have this can all data types be tracked.
The answer to this is well it comes with some restrictions.
Most of the fields are tracked.
So when I say that they are tracked all the entries are tracked including the date time nature of the
change and who made the change.
All these details are tracked but there are restrictions to certain fields basically fields with more
than 250 freed characters.
They aren't tracked as edited and they are all and new values.
They are basically not captured.
Say for example that is a number field and we enable the track field history for that particular field.
So it says are too much changed the value of this particular no field from 10 to 20.
But in case of a mighty select pick list it wouldn't say the same.
It wouldn't hold the values basically it was happening before.
And the new Values Institute would say cannot change the mark select pick list to field this one.
And with the date that's it.
He didn't give us the old values and the new values.
So basically there is a difference in capturing the data.
So that's what I said.
It comes with some restrictions and we should also note that changes to time fields they have not tracked
in the field histories related list.
So these are a couple of pointers we need to understand while enabling field history for objects and
for fields.
Basically how many fields can be tracked and about the data types that can be tracked in this scenario.
Let me just use credit hours owner and the course name and let me say save perfect.
So now that we have enabled the field history for a couple of fields here and the next thing what we
have to do is go for the particular object
and then pull the history related list into the layout.
So go for related list.
You will see a course history basically a related list with the object name and history.
So prior to the layout
perfect and now we see that.
Yeah.
So we see that this particular user created this record on this date and time.
Okay perfect.
Now let me edit the credit hours.
Let me say for credit hours and MVC and enter here.
Right.
So this is called us field history tracking.
We are tracking the changes that are taking place in a particular field.
And now let me say it does not for a just five.
And do we see the difference.
So basically these fields are those fields wherein the all and the new values are captured.
If we do a similar thing for a field like a multi select pick list or a text area law then in that scenario
the action would be different.
It would just say change to the or the multi select backlist field value just the field leap sorry and
not the values.
So that is the difference.
But however the changes are tracked but just that some field types come with the restriction and this
is all we configure field history tracking for custom objects.
Similarly we can configure field history tracking for standard objects as well let's say we would like
to enable the field history tracking feature for the icons object so go for set up look for accounts
and here you would see the button set history tracking once you hit the button first do we need to enable
them field history tracking feature for accounts and then we need to select the fields that we would
like to track for accounts and a similar to custom objects even here we have the same restriction we
can enable it only up to 20 fields per object.
And similarly like we had for custom objects here also there are some restrictions when it comes to
data types time fields are not tracked and there are certain fields where it's more than 255 characters
only the changes are tracked but not the values as such.
So here let me choose a few feels safe perfect and again similar to what we did in custom objects go
to the detail page and then pull the
related list.
That is account history
save
and this is our field history tracking related list.
So any changes that we make to the fields that are tracked by field history all these changes will be
recorded out here perfect.
So now we know how to configure this functionality for standard objects and custom objects.
And there are a couple more ideas that we need to read off.
When we use this field history tracking First comes the reports.
So how do the reports are impacted when we enable this concept of field history tracking first.
Veneman the name we feel history tracking automatically like we'll have report types with field history
so those data that are being captured will be able to pull out another report.
So let me create a new report and look for the history reports.
And do we see that we can use all these history report types in building other reports and these on
the standard report types that are available so I can choose that particular report type.
And we can create our wonder reports.
And why do we have this understanding about creating reports using the official history data.
We should also be aware all for one of the.
Again a restriction I wouldn't call that as a restriction it is basically a recorded as a sensible idea.
And it is a limitation as of now since wells may implement that idea any time.
Basically these will not be able to create a custom report type using this history report that is already
recorded and ideas.
Let me show that to you.
This is the same false idea about creating a custom report type using the history tables.
So basically we will be able to use the standard history report types and we can build other reports
but will not be able to use this history table in combination with the different table and create our
custom report types the way the similar way we do it with other objects and we can see that people have
already ordered for this idea.
So hopefully science falls will implement this in some time
and this is all about field history tracking.