LinkedEntity polymorphic relationship field not returning data on SOQL
We have a custom object Client_Intake_Upload__c with custom field Hub_Spoke_Account__c that is connected to ContentDocumentLink object. The polymorphic relationship field on ContentDocumentLink is called LinkedEntity. When we run the query below, ContentDocumentId and LinkedEntityId get returned but not Hub_Spoke_Account__c (which is not null).
SELECT ContentDocumentId, LinkedEntityId , TYPEOF LinkedEntity WHEN Client_Intake_Upload__c
THEN Hub_Spoke_Account__c END FROM ContentDocumentLink
WHERE LinkedEntityId IN (SELECT Id FROM Client_Intake_Upload__c Where Status__c="Uploaded")
How can we get Hub_Spoke_Account__c to show?
Read more here: Source link