Tell me more ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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?

share|improve this question
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

2 Answers

up vote 4 down vote accepted

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

share|improve this answer
Thanks a lot this is what I was looking for.. – Prafulla Patil Sep 8 '12 at 21:20

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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