How query CombinedAttachment in Salesforce?

How query CombinedAttachment in Salesforce?

CombinedAttachment is a read-only object which contains all the Google Docs, Documents, Notes, and Attachments uploaded to libraries in Salesforce CRM Content, and also the files added to Chatter that are as part of a record.

We cannot query CombinedAttachment object/entity as Query() is not supported. So, we can use Sub-Query to fetch CombinedAttachment records.

Sample SOQL:

Case objCase = [ 
	SELECT Id,
	( SELECT Id FROM CombinedAttachments )
	FROM Case
	WHERE Id = '<CaseRecordId>'
];
System.debug( 
	'CombinedAttachments Count is ' + objCase.CombinedAttachments.size() 
);

Leave a Reply