Archive for September, 2011

September 12, 2011

Adding Reply and Forward buttons to the email activity page layout

by Venkat Polisetti

Many times when I am going through the Activity History of an Account or Contact and wanted to reply to an email or forward that to some one else, I see that the standard Activity page layout in Salesforce does not provide any buttons to do that. When you click on an Activity in the Activity History, all you see is buttons for edit/delete and follow up task or event. I wish I could directly Reply or Forward that activity from with in Salesforce without going out to my email client on my desktop. It will come handy when we do not have access to our email client for whatever reason that is.

We are going to provide the Reply and Forward Email buttons on the Task Activity page layout. To do that we need to do the following:

Add two custom buttons to the Task object

  • Crate a custom button with a lable “Reply Email”.

Head out to Yourname->Setup->App Setup->Customize->Activities. Click on Task Buttons and Links. Click New button under Cutsom Buttons and Links section at the bottom of the page.

Here is the URL text for the above button:

/_ui/core/email/author/EmailAuthor?p2_lkid={!Task.Who} &p3_lkid={!Task.What}&p6=RE:{!IF(BEGINS(Task.Subject, 'Email:'),  RIGHT(Task.Subject, LEN(Task.Subject) - 6) , Task.Subject)}&p7=%0a-------original Message-------%0a {!Task.Description}&retURL=/{!Task.Id}
  • Create a custom button with a lable “Forward Email” just like the above “Reply Email” button but use the below URL text:
/_ui/core/email/author/EmailAuthor?p2_lkid={!Task.Who} &p3_lkid={!Task.What}&p6=FW:{!IF(BEGINS(Task.Subject, 'Email:'),  RIGHT(Task.Subject, LEN(Task.Subject) - 6) , Task.Subject)}&p7=%0a-------Original Message-------%0a {!Task.Description}&retURL=/{!Task.Id}

In the above url we simply maniputlates the subject and prepend to the discription a line with a string ——-Original Message——- to seperate the original message from what you may include in your reply.

Modify Task page layouts to add the above custom buttons

  • Yourname->Setup->App Setup->Customize->Activities. Click on Task Page Laouts. Drag the custom buttons on to the layout

Thant’s all to it.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: