Friday, 1 March 2013

Check in Apex if Chatter is enabled or not for current Org

Check in Apex if Chatter is enabled or not for current Org : there are the easy way to find out is chatter is enabled or not for current org by finding iv "FeedItem" is exists or not in org.

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

2 comments:

  1. Hi,

    Very interesting, where/how should this script be run?

    Thanks

    ReplyDelete
  2. Thanks :) You can run this script in debug log as well you can use in your code also as per needed..

    ReplyDelete