[SalesForce] Query ContentVersion with Community User

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

Best Answer

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

Related Topic