You need to sign in to do that
Don't have an account?

generic method to track field history
Hi All,
i want to Develop a generic method which can be used in any object’s trigger and it should then start creating History Tracking records.
how to do it?
Any suggestions?
i want to Develop a generic method which can be used in any object’s trigger and it should then start creating History Tracking records.
how to do it?
Any suggestions?
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_accounthistory.htm
That means if you do something like that, you'll get a "field not writeable" error :
You can activate History Traking from the UI :
https://help.salesforce.com/articleView?id=tracking_field_history.htm&type=5
i want to track history by generic method and i think it possible but i dont know how to do it ?
Any suggestion?
Here let's say you have an Account with Id = 1234 , if youd do getHistoryForRecord('Account', 1234), the method would return full history for the record.
i have a requirement in which i want to make a generic method which can be used in any object’s trigger and it should then start creating History Tracking records. history of fields should be recorded. for this i made a visualforce page in which i have a list of sObject dropdown list and i select a Object from this list than its field are showing as checkbox than i select field which i want to track the history than these fields are saving in a object Called FieldTracking__c which has selectedField__c (textArea). this is done by me .
Now i want to develop a generic method in which i want to track the history of field which i selected in checkboxes for particular Object.a generic method which can be used in any object’s trigger and it should then start creating History Tracking records.
a method which i call in an Object and its strat creating history for the records
how to do it ?
guide me please
i have found a link similar to it :-https://salesforce.stackexchange.com/questions/14728/how-should-i-build-custom-history-tracking-for-a-large-number-of-fields
but i didn't get it how to use this in my requirement ?
i have a object Custom Object : HistoryTracking__c to save history tracking records for fields where history tracking is enabled.the custom Object has following fields:-Custom Fields : ObjectName__c, FieldName__c,OldValue__c,NewValue__c
how to do it?