+ Start a Discussion

Dynamic deployment of chatter community feature.

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?

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.