Pages

Monday, May 26, 2014

Salesforce Last Activity Date



Many of us may not be aware that Salesforce has the Last Activity Date field. This field is not available in Page Layout by default, but is available in:
  • Report
  • List View
  • API (including Formula Field, Workflow, and Validation Rule) for 
    • Account
    • Contact
    • Opportunity
    • Lead
    • Custom Objects

It is important to note that the Last Activity Date is different from the Last Modified Date. Last Modified is the date and time stamp when the last update was made to an individual record, for example, changes to a phone number or an address); this also includes the user who made the change.

Last Activity shows when the last activity is related to a record, it represents one of the following:
  • The latest Due Date of the Completed Task on the related record
  • The latest Date of the Event on the related record
Remember, it is NOT the Created Date or Last Modified Date of the Event or Task.


How the Last Activity Date is Calculated?
Each activity record has the different who_id (Contact and Lead) and what_id (other objects) fields in the Task / Event object. However, the value for the Account field is calculated by introspecting the who and the what, with the what taking precedence.

For example: when a user logs a call to a Contact or Opportunity, the Last Activity Date in Contact or Opportunity will be updated, and it will also update the Last Activity Date in the Account too.


Notes:
  • Task/event from a child (for both lookup and master-detail relationship) will not roll up to the parent record, including the Last Activity Date.

Notes for the "account_id" field in Task:
  • If the What is an account, the account_id is that account.
  • If the What is an opportunity, the account_id is the account associated with that opportunity.
  • If the What is a contract, the account_id is the account associated with that contract.
  • If the What is a Custom object that is parented under an account, the account_id is the account associated with that custom object.

Reference



No comments:

Post a Comment