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
Nakul ChaudhariNakul Chaudhari 

Issue with handling Shared Activities enabled/disabled in managed package

I have a managed package and I wanted to create or update tasks through Apex. We also would like to include this in managed package. While researching I found that to update WhoId field of tasks through Apex when Shared Activities are enabled we have to use "TaskRelation" object.

However, if I include "TaskRelation" object into package, the package is not getting installed on the Salesforce org where "SharedActivities" feature is not enabled.

Can anybody help me out with this? How can I handle this dynamically in package?

Thanks in advance.
Best Answer chosen by Nakul Chaudhari
Andy BoettcherAndy Boettcher
Check out this StackExchange post - does this help?

http://stackoverflow.com/questions/18864292/managed-package-that-contains-shared-activities-features-fails-to-install