I have a situation where I am trying to retrieve documents which were generated by DrawLoop and added to SFDC as Files. As the System Admin user, I can query for this data using the following query:
[Select Id, ContentDocumentId, ContentDocument.LatestPublishedVersionId from ContentDocumentLink where LinkedEntityId = 'a0t5C0000005Bk5QAE' and ContentDocument.Title = 'Decision Letter.pdf' order by SystemModstamp desc]
When I attempt to use this in Apex as a Server-Side controller to a Lightning Component, I am getting zero records returned while logged into our portal as a regular portal user. Is there a different/better way to get a ContentDocumentId if I am querying by parent id and document name?
For reference, the use case I'm looking to implement involves an administrative user clicking a DrawLoop button to generate and associate a PDF to a custom object. I am attempting to pull that document by using the code in this paste:
The end result is a clickable URL for the user that has access to the document(i.e. I can't open this up).
Has anyone else had to fight with using Files in a portal before?