Implementation restriction: ContentDocumentLink requires a filter by a single Id on ContentDocumentId or LinkedEntityId using the equals operator or multiple Id's using the IN operator. code example

Example: Implementation restriction: ContentDocumentLink requires a filter by a single Id on ContentDocumentId or LinkedEntityId using the equals operator or multiple Id's using the IN operator.

Map<Id, ContentVersion> mapCV = new Map<Id, ContentVersion>();
Set<Id> setId = mapCV.keyset();
List<ContentDocumentLink> listCDL = [SELECT LinkedEntityId, ContentDocumentId, Visibility 
                                     FROM ContentDocumentLink WHERE ContentDocumentId IN: setId];

Tags:

Misc Example