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.

I need to get documents of a particular library using SOQL.

SELECT title FROM ContentVersion where Contendocument.Parent.Contentworkspace.name='EMEA Sales'

The error i get is INVALID_FIELD: on Contendocument.Parent.Contentworkspace.name

The ERD model for content objects can be viewed here http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_erd_content.htm

share|improve this question

1 Answer

The following worked for me:

ID workspaceId = [SELECT Id FROM ContentWorkspace WHERE Name = 'EMEA Sales'][0].Id;
List <ContentVersion> allDocuments = [SELECT Title FROM ContentVersion WHERE ContentDocument.ParentId = :workspaceId]);
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.