Timesaver # 5 – Viewing Comments on Activity History Related List

Hey all,

So, one thing that has come up every once in a while are clients who want to see the comments, or part of the comments on an Activity History related list.  The comments field is a Long Text Field; as such, unfortunately you cannot just add that field to the related list and have it show.  However, a few quick steps and you can see some of your comments.

First – why?  Well, let’s look at the native Activity History list…

As we can see, we know that we have had 2 telephone calls and one email with this contact.  But to know what each is about, we’d either have to click into each activity to read, or print out an activity report.

How do we fix this?  Here we go….

Step 1: You need to make a custom field under Activity custom fields.  I call the field Summary – you can call it what you wish.  The important part is that you make the field a Text Area field (255) and you do not put it on the page layouts (your users will not need to look or play with the field).

Step 2: You need to create a workflow rule.  The information is as follows:

Name: Set Summary for Tasks
Object: Task
Evaluation Criteria: Every time a record is created or edited.
Rule Criteria: use formula, and enter true into the formula box.

The action will be a field update:

Name: Set Summary to Short Description
Field To Update: Summary (or whatever you named the field)
Formula: LEFT(Description,252)&”…”

Step 3: Add the new field to the related list view on the Contact.  You do this on the Contact Page Layout edit screen, click on the wrench beside the Activity History related list, and add the Summary field to where you wish to see them.

Now, with each time an activity is created, or a current one is edited, the Summary field will now be populated.  With this, your users will now see the following:

So, hope this one helps folks.  Don’t forget to check out the info on the Summer ’11 release for salesforce.com, coming in June!

12 Comments

Mike Richardson 9 February 2012 Reply

Hello, this is exactly what I’ve been looking for but I keep getting the error, “Error: Formula result is data type (Text), incompatible with expected data type (true or false).” My object is “Task”, evaluation criteria is “Every time a record is created or edited”, Rule Criteria is “formula evaluates to true”, field to update is “Field Summary” so my formula is is LEFT(Field_Summary_c, 255). In the instructions there is also a &”…” after the formula but I’m not sure what to put there. Can you please help?? Thank you, I’m so glad I stumbled across this!!

Mike

Nik 10 February 2012 Reply

It sounds like you’re using the field update workflow as the criteria. On your main page of the workflow, your evaluation should be to “formula evaluates to true”, and then simply add in true as the formula. On the field update, this is where you use the LEFT(Detail__c,252) & ‘…’ formula. The & ‘…’ simply adds three dots on the end of the summary so that people know there could be more. Hope this helps!

Mike 10 February 2012 Reply

Thanks for the reply Nik! I think we’re I’m going wrong is where you say “then simply add in true as the formula”. I don’t see where to add the “true” to the formula? I just recently went to the Admin 201 Course for Salesforce and have only been our admin for a couple weeks so this is my first attempt at a workflow rule, so please forgive me if this is something an admin should already know!!

So my evaluation criteria is “Every time a record is created or edited”, my rule criteria is “formula evaluates to true”, and my formula is LEFT( Field_Summary__c , 252) & “…”

I’m still getting the error, “formula result is data type(text), incompatible with expected data type(true or false”, so it seems like I needd to add “true” to the formula somewhere?

Uggghhh, I’m SOO close!! lol

Thanks again for your help!!

Nik 13 February 2012 Reply

No problems, Mike – and yes…you are VERY close. Here’s an image of what your first screen should look like, and I think this will help out where the true/left formula mixup is. Enter as it is, then click Save. The link for the image is http://www.xlerate.ca/images/wf1.png

Now, after this, you can add the field update as an action. This is when you get a choice to use a formula to update the field, and this is where the LEFT(…… formula goes. You can see that here. http://www.xlerate.ca/images/wf2.png

Hope that helps!

Antoine 20 January 2013 Reply

Hi Nik,
Thank you very much, this is a helpful tip.

As a modest contribution, here is my version of the workflow formula : I wanted to have the 3 dots only when the text is longer then 252 characters.

LEFT( Description , 252) &
IF(
LEN(Description) >252, “…”, “”)

Again, thank you very much Nik, have a nice day,
Antoine

nik 15 February 2013 Reply

Thanks Antoine! Glad you found it useful! And that’s an excellent addition.

Shlomo 23 February 2017 Reply

This is amazing – just what i was looking for. If i want this summary to show on a custom lead field, and continue populating this field with new activity summaries, is there a way to do this?

Daniel S 6 September 2017 Reply

Hey Nik,

My coworker and I found ourselves in a situation where we’re pretty much editing SF for a start-up company as situations arise.

Neither of us had any previous experience with editing SF or even coding for that matter as that’s not our field of expertise but what we do have is a gung-ho attitude with a willingness to learn.

We found ourselves wanting and a certainly level needing comments to be displayed instead of always clicking on a link to show said comments. Just wanted to drop you a quick line, (apologies for the necro post), and thank you for this quick guide. Not only did this show us how to do what we needed to but also gave both of us a better understanding of how to update/code SF for the future.

Thank you again and have a great day.

nik 6 September 2017 Reply

Glad you found it helpful!

Tobias 7 December 2017 Reply

Great solution, thanks a lot. I just have one problem. Do you know if it is possible to eliminate line breaks when the workflow is triggered. The email correspondance with our customers is automatically synced with Salesforce and this will cause a lot of line breaks in the comment field. The problem is that this will totally mess up our list views.

Victor 13 February 2018 Reply

Nik, this time saver is Genius, thanks a lot!!!

George 29 May 2019 Reply

I followed this and it works great for classic, but this new field doesn’t show up on an activity history single related list in lightning. It’s just gone. Switch to classic and there it is.

Leave a Reply

Are You Smarter Than A Spambot? *