0

Hello, I develop a community and I need to display a button when the customer click on it, he download the file which is a PDF file stored like a file in a contract record.

I read the documentation and know I have to query records in the ContentDocumentLink object and the ContentDistribution object.

The documentation says: "For organizations with Communities enabled, a document can only be shared with users and groups that are a part of the community the file was created in." https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentdocumentlink.htm

Unfortunately, the community profile can't query the ContentDocumentLink because the SOQL query return nothing.

The file has been stored from Salesforce and not from the community.

Do you have an idea to help me please?

Thanksenter image description here

  • 1
    Unless the record and the file has been shared with the Community Users, Community Users won't be able download it. You have to make sure that you share the record/file with appropriate users. – Jayant Das Jan 22 at 17:22
  • Yes, the file is shared with community users. But, how can I get the sharing link to display in the community? – Aurélien Laval Jan 23 at 10:34
  • 1
    Have you checked this help article and assigned the required permissions? – Jayant Das Jan 23 at 15:37
  • Yes, I check that link and I can get the public link of a file when I click on the link "Public Link" if the file was uploaded via chatter and made with "With All Access". So it works for me, thank you. – Aurélien Laval Jan 24 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.