+ Start a Discussion

Community feature deployment

I have a question regarding community deployment. We are developing community related features in our product. So some of our code includes the use of 'Network' object. While installing package with this code, the destination org requires community should be enabled otherwise it gives installation error. 
Is there any way to make the deployment of community features dynamic? 
i.e: If the destination org doesn't have community enabled then it will install the package without giving any error but community-related features won't be enabled (or installed). OR if destination org has community enabled then it will install the app with community-related features. 

Sagar PareekSagar Pareek
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe(); 
   system.debug('Community enabled!');
   return true;
   system.debug('Community disabled!');
   return false;
You can check for communities using above code.

You cannot enable/disable communities or any subset of features of communities using Apex.
Hello Sandip,
Did you manage to resolve this problem? I have the same problem in my package. I want to install the package and disable community features or not install community related code.

Hi Nir
I have tried many things to enable/disable community, but I could not able to do that..
and hence I have comment out all the community code from the Apex Class
I know that this is not the solution.. but I didn't get any other info regarding how to do this

If you find anything regarding this, please inform replay here