Why doesn't Salesforce support semi join selects
on the ContentDocumentLink
entity?
Why would there be a random entity that doesn't work like all the others?
This code:
List<ContentVersion> contentVersions = [SELECT VersionData
FROM ContentVersion
WHERE ContentDocumentId
IN (SELECT ContentDocumentId
FROM ContentDocumentLink
WHERE LinkedEntityId = :recordId)
ORDER BY CreatedDate DESC LIMIT 1];
Throws this error:
Entity 'ContentDocumentLink' is not supported for semi join inner selects