6

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?

  • Can you clarify, are you asking if chatter is enabled on the object at all, or are you only asking about field history tracking in the feed? – ca_peterson Sep 8 '12 at 19:16
11

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).

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.