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

How to track Task
Hi, For opportunity we have OpportunityHistory object to track some fields in opportunity. same as Lead(LeadHistory), case(caseHistory).. But we dont have Task history object for Task..So Please tel me how to track fields in task object....
If any idea would appreciate...
Hello,
Task and Events belong to object Activities, so for task history it is Activity History.
This feature is provided by salesforce it self. if you have enable allow history or tracking on any Task object then you can get track it easily. One more thing this is tracked in a related list.
I believe what you are looking for is the ability to track Field History for Task/Event fields, so that anytime a field value is changed, it is tracked and can be reported on (correct me if I am wrong)
Well, natively, Salesforce.com does not offer Field History tracking for Activity Fields. The Activity History table holds all Completed Activities and not the history of field level changes to open/closed activities.
What you CAN do is create a custom object (with the same fields as Activities) and then write a trigger that creates a new record in this object each time a field in the Activities is changed. You can then also report on this object. The key to this solution would be how intelligently the object's data model is designed. Do take note that you cannot link this object to Activities as you cannot create a Lookup on Activities.
However, the downside of this solution would definitly be development and ongoing administration, as each time you add a new field to Activities and want to track its changes, you would need to add it to this object as well as to your trigger. So think about this route only if this is a must have requirement for your
Hope this helps. Let me know how it goes. Good luck!
The Activity History table holds all Completed Activities and not the history of field level changes to open/closed activities...
Yes, obviously correct....you are telling wirte one trigger and whenever Task insert or update, and one custom object records inserted... yes, i can understand very clearly..Instead of ( write trigger and create custom object ) if and idea Please post me...
I am afraid a custom object + trigger would probably be the only solution, as you want to track each of the field level changes made to the activity fields. Though we can also use custom objects instead of standard activities, but I would NOT recommend that as you will lose on a host of standard functionalities like Calendering, Outlook Sync, Reminders, Workflow Tasks, Pop up alerts and more.
Looks like this would probably be the only way out for you Preethi. Let me know if you need further help!
Hi All,
The code below will manipulate the Description Field on a Task to always stamp user name and date time to keep a history of this field. See Exmple Below:
Create Apex Class
Create Task Trigger
If I try to edit a task without a previous comment then I receive this error..
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger Task_BIBU caused an unexpected exception, contact your administrator: Task_BIBU: execution of BeforeUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Class.Task_HDL_BIBU.updateRecord: line 71, column 1
Any fix for this?