Salesforce Fact #834 | AccountId field on Task and Event
There is a field called 'AccountId' in Task and Event object. This field holds the related AccountId automatically whenever the WhatId is an Id from any of the below objects: Account Opportunity Contract Custom object that is a child of account When the WhoId is a ContactId and WhatId is any other object, in that case it stores the related AccountId of the contact. In all other cases, the AccountId is null. Reference: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_task.htm