You need to sign in to do that
Don't have an account?
problem running a SOQL query on newsfeed
Hi I am trying to run the following query from the Developer Console's Query Editor, but I am getting the error shown below:
SELECT Id, Type, CreatedDate, CreatedBy.name, Body FROM NewsFeed WHERE Type= 'UserStatus' ORDER BY CreatedDate DESC, ID DESC LIMIT 10
I am getting the following error:
sObject type 'NewsFeed' is not supported.
I am actually trying to run the query from a web app using the following (authenticated using oauth2.0):
QueryResult results = connection.query("SELECT Id, Type, Body, Title, CreatedBy.Name FROM NewsFeed ORDER BY CreatedDate DESC, Id DESC LIMIT 20");
However that is giving exception message, that is same as above from Developer Console's Query Editor, and shown below. Any help on what I am doing wrong.
exceptionMessage='sObject type 'NewsFeed' is not supported.'
http://www.salesforce.com/us/developer/docs/object_reference/
Use Chatter REST API or Chatter in Apex to access the News Feed:
http://www.salesforce.com/us/developer/docs/apexcode
http://www.salesforce.com/us/developer/docs/chatterapi
Hi, I ran into an additional problem while running the query from the java web application.
I was able to do the following SOQL query from Developers Console's Query Editor:
SELECT Id, CreatedDate, Title, CreatedBy.Name FROM feeditem ORDER BY CreatedDate DESC, Id DESC LIMIT 20
HOWEVER, when I ran the same query from my java application using the call below, I got the exception shown below. Any help?
QueryResult results = connection.query("SELECT Id, CreatedDate, Title, CreatedBy.Name FROM FEEDITEM ORDER BY CreatedDate DESC, Id DESC LIMIT 20");
Query exception=[InvalidSObjectFault [ApiQueryFault [ApiFault exceptionCode='INVALID_TYPE'
exceptionMessage='sObject type 'FeedItem' is not supported.'
Thanks,
Ruhul
How did you query against the data? Do I need to have access to the Chatter database?I need to query my companys chatterdatabase but not sure how to get started. I just have a login id to chatter as an employee.
There are multiple ways, of course, dependent on what you want to accomplish. The easiest way is to just do SOQL queries from the Developer Console's Query Editor. As the developer/admin for your company, you should already have access to the tables containing the chatter data. If not, you will need to set the proper permission. In the Developer Console's Query Editor, try the following:
SELECT Id, Type, CreatedDate, Body, Title, CreatedBy.Name FROM FeedItem ORDER BY CreatedDate DESC, Id DESC LIMIT 20
See if that works.
Querying from an integrated app is the other way. For that, there are number of more involved ways to get and utilize the data. Let me know what you are trying to do.
rq9c
I am just trying to analyze Chatter posts and do sentiment analysis and data mining on them. Your method sounds easy but is there any step by step instructions as to how and where to download Developer's Console and further steps. How do I set the proper permission to get access to the tables? I am not an admin or a developer but a business analyst. I know how to write queries in SQL though.
I highly appreciate your help and information.
You may already know this, but you can start from here:
http://developer.force.com/chatter
I am assuming you have a bit of time on your hand to do this :) It might take some time investiment from your side. You will also need to get the admin and developer profile/roles/permission from your administrator, if you are not the admin.
I am also trying to do something similar, if you have some time, I would love to discuss.
Sorry for getting back late. I finally got a Sandbox environment set up but i dont see the Developer Console under my name? What am I missing now.
Thank you very much. Yeah I dint had the proper permission set. Its been fixed now.