function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hoc NgoHoc Ngo 

Is it possible to find all ContentDocumentLinks that have opportunities?

Hello, 

We have documents uploaded to the ContentDocument object that is shared to the ContentDocumentLink object. 

Is there a SOQL query I can use to find all ContentDocumentLinks that contain '006' in the LinkedEntityID?

Would be great if I can find one! Thank you
SELECT ContentDocument.title, LinkedEntityID FROM ContentDocumentLink WHERE ContentDocumentId = '0692j00000Fh0kQAAR'
User-added image

 
Best Answer chosen by Hoc Ngo
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

It is very hard to use like operator when quering ContentDocumentLink and even it does not work. It is one of the major limitation. I had gone through one of the stack exchange question which is similar and it was answered that it can be done using python script.

Can you explore if that is helpful.
https://salesforce.stackexchange.com/questions/209973/query-to-see-all-files-related-to-specific-object-events


If this solution helps, Please mark it as best answer.

Thanks,
 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

It is very hard to use like operator when quering ContentDocumentLink and even it does not work. It is one of the major limitation. I had gone through one of the stack exchange question which is similar and it was answered that it can be done using python script.

Can you explore if that is helpful.
https://salesforce.stackexchange.com/questions/209973/query-to-see-all-files-related-to-specific-object-events


If this solution helps, Please mark it as best answer.

Thanks,
 
This was selected as the best answer
Hoc NgoHoc Ngo
thanks for your response! Wow looks like they were doing something similar to what I am currently doing. Sadly I dont know how to use Python :(

Thanks alot for your help!