You need to sign in to do that
Don't have an account?
Code Help: Got a list of ContentDocumentLinks, want to end up with a list of the LinkedEntityIds of a certain sObject type
I've got a list of ContentDocumentLinks that's going to come from a trigger. (Or, in my current testing phase, is from this SOQL query:
ContentDocumentLink cdl : [Select Id, LinkedEntityId From ContentDocumentLink WHERE LinkedEntityId in ( SELECT Id FROM User)]
I need to loop through that and end up with a list of the LinkedEntityIds that are of a particular object. (In this case, a custom object Expenses__c.)
Help please?
ContentDocumentLink cdl : [Select Id, LinkedEntityId From ContentDocumentLink WHERE LinkedEntityId in ( SELECT Id FROM User)]
I need to loop through that and end up with a list of the LinkedEntityIds that are of a particular object. (In this case, a custom object Expenses__c.)
Help please?
for(ContentDocumentLink cdl : [Select Id, LinkedEntityId From ContentDocumentLink WHERE LinkedEntityId in ( SELECT Id FROM User)])
{
if(cdl.LinkedEntityId.getSObjectType() == Expenses__c.sObjectType)
{
setExpenseId.add(cdl.LinkedEntityId);
}
}