How to update related contacts when shared activities are logged using flow?

What are Shared Activities?

Shared activities is a feature that allows association of multiple contacts to a single task. This feature can be turned on by navigating to Setup | Feature Settings | Sales | Activity Settings. Turning on this feature may take up to 48 hours depending on the number of tasks that already exist in the Org.


Problem: Standard LastActivityDate field in contact object does not get updated on all contacts when a task is associated to multiple contacts. Only the primary contact's LastActivityDate is updated by default. Reports using LastActivityDate will have wrong Activity Date.

Solution: Create a custom datetime field and update the field using the flow to track contact activities. LastActivityDate is a read only field and cannot be updated. 


Expanded view of flow components for reference:
  • Record-Triggered Flow 
  • Get Related Task Who Records 


  • Iterate Task Who Collection

  • Check if the Who type is 'Contact'

  • Bulkify the Contact Update Collection by creating individual contact record and adding it to the collection

  • Update the collection




Comments

Popular posts from this blog

How to get CustomNotificationTypeId in flows without hardcoding?

How to Mass Transfer Opportunities using Salesforce Flows

Understanding vCore CPU utilization in MuleSoft CloudHub