0

I have an external application that depends on a user installing my managed package to create some custom fields etc. My external application creates calendar events and allows the user to add multiple contacts to events through the EventRelation table.

I've discovered that this table looks different depending on whether or not the Shared Activities setting is enabled. My application expects that it IS enabled and adds contact entries to the EventRelation table (IsWhat=false).

My question is, is it possible to enforce this option be enabled when they install my managed package?

If the answer is no, I assume my application should check whether or not it's enabled? And if it's not enabled does that mean I can't add multiple contacts to Events?

1

A package cannot actively force settings such as Shared Activities. There are many types of settings that the package can be dependent on, but if it has such a dependency, the installer will instead block installation until the dependency is satisfied. For example, if you create a package that requires multi-currency, then the org cannot install the package unless it has multi-currency enabled. You can read more about the details in Understanding Dependencies. The note says:

NOTE An installer’s organization must meet all dependency requirements listed on the Show Dependencies page or else the installation will fail. For example, the installer's organization must have divisions enabled to install a package that references divisions.

So, ultimately, if you can't form a dependency, you cannot enforce a given condition existing in the org. And even if you could, it would simply block installation until the dependencies were satisfied. You will need to take the extra effort to detect if the feature is enabled and take appropriate action depending on that determination.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.