You need to sign in to do that
Don't have an account?
Kevin Dillon 18
SOQL where clause not working
I have a custom boolean field that I've added to Files that I'm now trying to use in a SOQL query to pull all Files that are linked to a specific record where this custom field is set to TRUE. Here's my SOQL query:
SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityID = 'a00f400000RaXnDAAV' AND ContentDocumentId IN (SELECT ContentDocumentId FROM ContentVersion WHERE Send_to_Angeion__c = TRUE)
What's odd is that this query:
SELECT ContentDocumentId FROM ContentVersion WHERE Send_to_Angeion__c = TRUE
Never returns any results, even when I've marked the Send_to_Angeion__c as TRUE on some records. And even more interestingly, this query
SELECT ContentDocumentId, Send_to_Angeion__c FROM ContentVersion WHERE ContentDocumentID = '069f400000Azta2AAB'
will return results and lists the value in the Send_to_Angeion__c as "true" Any ideas on how I can fix this?
TIA
SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityID = 'a00f400000RaXnDAAV' AND ContentDocumentId IN (SELECT ContentDocumentId FROM ContentVersion WHERE Send_to_Angeion__c = TRUE)
What's odd is that this query:
SELECT ContentDocumentId FROM ContentVersion WHERE Send_to_Angeion__c = TRUE
Never returns any results, even when I've marked the Send_to_Angeion__c as TRUE on some records. And even more interestingly, this query
SELECT ContentDocumentId, Send_to_Angeion__c FROM ContentVersion WHERE ContentDocumentID = '069f400000Azta2AAB'
will return results and lists the value in the Send_to_Angeion__c as "true" Any ideas on how I can fix this?
TIA
Also try in your first query remove LinkedEntityID to ContentDocumentId
Above query is working absolutely fine for me. You should check once if you are querying the right LinkedEntityID.