Friday, April 14, 2017

How to check If Chatter is enabled or not for current Org using APEX

Below code can be used to check if chatter is enabled or not for
current org by finding the "FeedItem" is exists or not in org.

Map<String,Schema.SObjectType> globaldesc = Schema.getGlobalDescribe(); 
if(globaldesc.containsKey('FeedItem')){
   system.debug('Enabled!');
}
else{
   system.debug('Disabled!');
}

No comments:

Post a Comment