Makes files uploaded to Salesforce records visible to Experience Cloud users. By default, Salesforce sets ContentDocumentLink.Visibility to InternalUsers when a file is attached to a record, which hides the file from external users even if they have access to the parent record.
Salesforce Help Article: https://help.salesforce.com/s/articleView?id=005101347&type=1
ContentDocumentLinktrigger (before insert) callsContentDocLinkVisibilityHandler, which setsVisibilityon each newContentDocumentLink.- The trigger has no effect when Experience Cloud is not enabled for the org.
- Configuration lives in the
Content_Document_Link_Visibility_Setting__mdtCustom Metadata Type. AContent_Document_Link_Visibility_Setting__mdtmust be created for each SObject type to apply the new default to. - Each record's
SObjectfield (a lookup to the object) is required and unique: one setting per object. - Each record's
Default Visibilityfield is required:All UsersorInternal Users.
Only new ContentDocumentLink records are affected. Existing files from before package installation with Visibility = InternalUsers are unaffected.
- ⚙️ Setup -> Search "Custom Metadata Types" -> Find
Content Document Link Visibility Setting-> ClickManage Records-> ClickNew - Create and Save a Setting:
- Label: [Your SObject's Label]
- Content Document Link Visibility Setting Name: [Allow to auto-fill]
- Default Visibility:
All Users(Default) - SObject: [Find and select your SObject type]
- Click
Save
To work on this project in a scratch org:
- Set up CumulusCI
- Run
cci flow run dev_org --org devto deploy this project. - Run
cci org browser devto open the org in your browser.