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
lakshmi yelurilakshmi yeluri 

when a task is created for a contact , how can a developer prevent the task from begining included in the activity time line of the contacts account rcord

give the answer
 
Khan AnasKhan Anas (Salesforce Developers) 
Hi Lakshmi,

Greetings to you!

Nothing. The Task is automatically displayed on the Account page. If you create Task/Log A call on contact then it will automatically display on Contact and it's respective Account activity section. 

There are few standard functionalities that Salesforce provides.
If the Task is created for Contact (WhoId is ContactId) then Task's AccountId is populated from Contact's AccountId.

There is also an example for Case creation. From the create Case page, if you select the Contact and don't select Account, then after saving, Case's AccountId is getting populated from Contact's AccountId. (Even if account id is not displayed on UI).

If Account is displayed on the UI, then you will see Account population is automatic based on Contact selection.

Reference: https://salesforce.stackexchange.com/questions/181507/why-task-is-on-account-in-related-list-salesforce-task-acccount-contact

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Anbarasan ParimalaselvanAnbarasan Parimalaselvan
Hi Lakshmi
Based on this link "https://help.salesforce.com/articleView?id=activities_enable_activity_rollup.htm&type=5"
the answer to your question is 'In activity settings,uncheck roll-up activities to a contact's primary account'

If this answers to your question, kindly mark this as the correct answer and close this question.