I have a simple question. Can users with Customer Community Login query the ContentVersion object?

  • what do you mean by query - running soql or accessing the record ? can you add more details to your question – Vamsi Krishna Sep 18 '14 at 6:29
  • I'm using the Customer Community Login License to upload a feeditem contentpost. It should create a contentdocument. I want to get the id of the ContentDocument by querying SOQL via ContentVersion object. The id link should be RelatedRecordId field of FeedItem. – Le Nguyen Sep 18 '14 at 6:33

Yes the users with Customer Community can query ContentVersion records

String communityId=Network.getNetworkId();//Use community Id to figure logged in Users Current Community

SELECT Id, FileType, SystemModstamp,Title, ContentUrl,ContentDocumentId,ContentDocument.LatestPublishedVersionId, PathOnClient, VersionData from contentVersion WHERE OwnerId =: UserInfo.getUserId() and NetworkId=: communityId order By CreatedDate DESC

| improve this answer | |
  • Does the networkId always have to resemble the id of the community? Can i be inside a community and have my networkId == null? – JPG Feb 19 at 15:42
  • No, your networkId will always have a value in Community Context. – Mohith Shrivastava Feb 19 at 18:49

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.