function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Medhanie Habte 37Medhanie Habte 37 

Automatically assign WhatID to Contact's Account Record when Composing Gmail


Some of our users currently use the Compose Gmail button on contact records to send an email via Gmail which creates a completed activity in Salesforce. However, we are wondering if there is a way to automatically assign the WhatId to the contact's account record based on the WhoID being a contact. It's tricky as we're dealing with a polymorphic field, but wanted to know if there are any workarounds to address. We commonly use Account records and have built custom lookup fields for other objects such as opportunities, cases, et al, which allows us to exclusively handle records in those objects.

Hope it helps,