Find your content:

Search form

You are here

Enable or check Chatter Feed Tracking programatically

 
Share

Is there any way to enable Chatter Feed Tracking programatically for a object in salesforce.com? If not, it is possible to detect if an object is chatter enabled?


Attribution to: Prafulla Patil

Possible Suggestion/Solution #1

I don't think so - this seems like one of those org configuration settings that SFDC has that can't really be modified in APEX.


Attribution to: jordan.baucke

Possible Suggestion/Solution #2

There are two things you could mean by "Chatter Feed Tracking", first is if individual field changes on the object are tracked in the chatter feed: I don't believe this is possible to detect.

The second is if chatter is enabled at all for that object (which is confusingly shown as "Enable Feed Tracking" on the object in the setup menu). This is possible to detect in apex.

First, you should check and see if chatter is enabled for the org at all. If chatter is on the User sObject will have feed tracking enabled under any situation (admins can't disable it for this object):

Schema.SObjectType.User.isFeedEnabled() will return true if chatter is on in the org.

From there you can check the specific sObject type that you're interested in via the same syntax but replacing "User" with the API name of the object you want to check. You can also use the global describe to do this dynamically (if you don't know the sObject type until runtime).


Attribution to: ca_peterson
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/1272

My Block Status

My Block Content