We have this record in Salesforce with Files attached to it.
When I execute this query as an administrator via the developer console, it gives me results:
[SELECT ContentDocumentId, ContentDocument.Title,LinkedEntityId FROM ContentDocumentLink WHERE LinkedEntityId =:contractId]
When I run the same query as a customer portal user it returns zero results.
Knowing that LinkedEntityId matches the id of a record that the portal user has access to, as shown in the image
Does anyone know why I don't get any results from this query as a community user or how I can get the public URL for this document via apex?
SELECT Id, (SELECT ContentDocumentId, ContentDocument.Title,LinkedEntityId FROM ContentDocumentLinks) FROM Contract WHERE Id =:contractId