function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
John GriffithJohn Griffith 

Activity history customisation

Hi
I cant seem to find any way to add a column to the activity history panel on a record that will display the comments (or at least the first few words of the comments) from the comments field of the call or activity the hostory relates to.
The whole point of a good CRM is to view the activity history itself over the recent activities not a list of links to other pages where the actual history resides!
Ross Gilbert 18Ross Gilbert 18
Hi-

I'm pretty sure SF won't let you put a long text area type field like the Activty "Comments" field on the Activity History related list on leads.  The only solution I can think of is:

1. Create a custom activity field of type Text or Text Area (255) on the activity object.  You could call this field "Comments Abbreviated" or something and not put it on any page layouts
2. Do a one time backfill on that new field to populate it with the first 255 characters of the Comments field, for each of your existing tasks, or just the ones you care about backfilling for.
3. put in a trigger on the task object that populates the field "Comments Abbreviated" whenever a task is created or updated, so it pushes in the first 255 characters from the task's "Comments" field.  Basically this:
trigger taskTrigger on Task (before insert, before update) {
    for(Task t: trigger.new){
        String comment = t.Description.substring(0,255);    
        t.test2__c = comment;
    }
}
4.  add the "Comments Abbreviated" field as a column on the Lead "Activity History" related list