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
sam87sam87 

Dynamic deployment of chatter community feature.

Hello, 
I am using Network object in Apex code. This object is used to develop one of the feature of the app based on community (This is not the only feature of the app, it is one of the feature of the app which is based on chatter community). To deploy this package, Community needs to be enabled in destination org. Because community is a paid feature for production org, in some cases clients don't want to buy and enable communities in their org. 
Just because of this reason, we are not able to deploy our package to other orgs. Is there any way to make this deployment dynamic? Meaning that first it will check the destination org for community. If enabled, it will install the package with network feature else it will install the app without that pieces of community (Network object) in apex code. Can I use dynamic apex or post install script to make this happen? If yes, How?

Thanks 
Sandip.
ShashankShashank (Salesforce Developers) 
You can probably use managed package extensions for this kind of scenario. You can create a base package without the communities feature and an extension which includes the communities feature. Orgs which do not have communities enabled can just install the base package. Orgs which have communities feature can install both base package and package extension.

https://help.salesforce.com/HTViewHelpDoc?id=publish_extensions.htm&language=en_US