Take the 2-minute tour ×
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.

We have VF page that allows a user to upload an attachment that we later convert to FeedItem. THe VF Page also allows updating the FeedItem by inserting a new ContentVersion.

The whole thing works fine in our dev org. We have created a managed package out of it and installed it to another Enterprise edition org. The same thing however doesn't works in Enterprise edition.

Instead of updating the FeedItem, the code is creating a new Feed. We have also found that query to ContentVersion based is not returning any values.

Can you give an idea what might be causing this issue?

share|improve this question
    
does you user have Salesforce Content User Permission? –  doga Nov 16 '12 at 3:18
add comment

2 Answers 2

I don't think you can update FeedItem, in the documentation, it's not an updatable() object.

That being said, it's interesting that you were able to do it in your 'dev' org unless you were confused. The managed package shouldn't have much to do with the functionality of the code, unless your using a @RemoteAction or some other client-side script that requires a namespace prefix?

share|improve this answer
    
No that's not the issue. we are not updating feeditem, we insert feeditem and then update ContentVersion object. –  Chirag Mehta Sep 26 '12 at 6:09
add comment

You can query the Contentversion to get the files posted on the Object. But before you can do this, you must make sure the files are shared to your API user or to the company.

This is because the access control of ContentVersion is a little different with others. see doc,

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_contentversion.htm

Users (including users with the “View All Data” permission) can only query files they have access to, including:

All Salesforce CRM Content files in libraries they're a member of and in their personal library, regardless of library permissions (API version 17.0 and later).

All Chatter files they own, posted on their profile, posted on groups they can see, and shared directly with them (API version 21.0 and later).

Therefore, even a user with “View All Data” permission and can browse the files in the interface; if the files is not shared to him, he still can't query the files by API.

share|improve this answer
add comment

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.