Our org has exhausted the limit of static resources. Mostly used in storing badge images for the certifications and exposed as a downloadable URL on customer community. I want to remove these images/zip from static resources and move it to Documents. I tried doing that and created a formula field with hyperlink funtion

[HYPERLINK("/servlet/servlet.FileDownload?file=0150U000000F04q", "badgedownload" , "_blank")]

The above field works for internal user but does not work for community users. Any idea why community users cannot download the documents? Note - Community profile has read-only access to documents.

Or are there any other option that I can use to make it work for community users?

  • MP, how many badges do you have? If you're storing unique badges for each recipient, maybe you should consider only storing the graphical portion of the badge as an image, then overlaying any text data using HTML & CSS.
    – Foo Bar
    Mar 6, 2020 at 17:14

1 Answer 1


You can use ContentDocumentLink with ContentVersion for storing your badges. These badges will be linked with records using LinkedEntityId. Set ShareType and Visibility to set visibility access.

Id conDoc = [SELECT ContentDocumentId FROM ContentVersion WHERE Id =:conVer.Id].ContentDocumentId;

ContentDocumentLink cDe = new ContentDocumentLink();
cDe.ContentDocumentId = conDoc;
cDe.LinkedEntityId = recordId;
cDe.ShareType = 'I'; 
cDe.Visibility = 'AllUsers';
insert cDe;

Visibility to AllUsers will make file accessible for community user as well.

In winter 20, we have feature now to Make Files on Records Visible to Customers

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .