Pages

Sunday, September 22, 2013

Salesforce: Log A Call with Activity Type auto populated

Type is a standard picklist field in Salesforce Activity object. User can add / remove values in the picklist.

When user click "Send an Email" button from Activity History related list of Account, Contact, Opportunity, or from any other object page layout, system admin can define default value equal to "Email" (for example). So, task created will be always assigned to Email.

But, when user click "Log A Call" button (also in Activity History related list ), Type will be blank. This is not ideal, system should be smart enough to auto-populate Type to Call (or any other value default in the system set by system admin).

Is the any workaround? YES. Here we go:
  • Create a custom button from: Setup - Customize - Activities - Task Buttons, Links, and Actions
  • Click "New Button or Link" button
  • Enter following data as screenshot below:
  • Click "Save" button to save it.
  • Go to object page layout, such as Contact page layout, edit the page layout and scroll to "Activity History" related list
  • Untick standard "Log A Call" button and add custom button created above

  • Done
But, here is the downside, if you notice in screenshot above, you see many buttons: "Contact Log A Call", "Account Log A Call", etc... this is because you need a button for each object. This is caused by the URL in the button
/00T/e?who_id={!Contact.Id}&tsk10=Call&retURL=%2F{!Contact.Id}

See there is Contact Id in who_id parameter, and for Account and Opportunity, you need to put their Id to what_id parameter.

2 comments:

  1. great post Johan - any idea why the button wouldn't show up in the activity history related list properties window when I go to add it to the page layout?

    Jon

    ReplyDelete
    Replies
    1. Jon, have you add the new button to each page layout ?

      Delete