The following code returns the error:
List<ContentDocumentLink> docLinks = [SELECT ContentDocumentId FROM ContentDocumentLink where LinkedEntityId in ( SELECT Id FROM Case ) and LinkedEntity.Type='Case'];
Set<String> docIds = new Set<String>();
for(ContentDocumentLink cdl : docLinks){
docIds.add(cdl.ContentDocumentId);
}
List<ContentDocument> docsToDelete = [SELECT Id FROM ContentDocument WHERE Id IN docIds];
system.debug(docsToDelete.size());
And this is the exact error:
I don't see why this should be happening and I suspect it may be a bug. Does anyone know what causes this?
:
in theId IN docIds
, or was that just a small typo? Yeah, it doesn't really have to do with what the error is reporting, but these unexpected token errors can be caused by darn near anything in my experience.