External file sharing (Record Files)

External file sharing (Record Files)

Version 11.4 extends Record Files so internal users can share a selected set of files with a client, auditor, compliance officer or other person who does not have a Salesforce login. The recipient gets a secure public link that exposes only those files.

The external page supports search, preview, individual download, bulk zip download, and merging the shared files into one PDF. It never exposes upload, edit or delete actions.

Every link is backed by a File Share (b3o__File_Share__c) record. Admins can report on access, deactivate the link, set an expiry, and automate notifications from the record's fields.

Create a share

  1. Open Record Files on the source record and select one or more files.
  2. Select Share in the selection bar.
  3. Choose the active Salesforce Site that will host the public page.
  4. Optionally set an expiry date and time, select a recipient Contact, or require a five-character access token.
  5. Select Generate link, then copy the link and, when used, the token.

Selecting a recipient Contact lets the packaged notification Flow send the link automatically. The server verifies that every selected file is reachable through the current Record Files definition before creating the share.

Generating a link requires the Share Files Externally (ShareFilesExternally) custom permission. It is included in Onboarding_Admin_Full_Permission, or you can add it to a narrower custom permission set.

The Share action is visible to internal users who can use Record Files, but the server rejects link generation when this custom permission is missing.

Limit recipient Contacts

By default, the recipient lookup can find any Contact. Add shareContactFilter to the top level of the Record Files Definition JSON to restrict the lookup with a server-side SOQL WHERE clause:

{
  "shareContactFilter": "RecordType.Name = 'Client'"
}

The server applies the filter to both the lookup results and the final link generation. The clause is not sent to the browser. If the key is omitted, all Contacts are available.

Recipient experience

The external page uses the columns from the Record Files Definition stored on the share, so it remains consistent with the internal file view.

File Share fields

Field Purpose
Active__c Controls whether the link is valid. Clear it to revoke access immediately.
Link__c Generated public URL for the share.
Expires_On__c Optional date and time after which the link is rejected.
Token__c Current access token. Blank means no token is required.
Context_Record_Id__c Record from which the files were shared.
Contact__c Set automatically when the context record is a Contact.
Shared_With_Contact__c Intended recipient and input to the packaged notification Flows.
Shared_File_Ids__c JSON array of the shared ContentDocument Ids.
Definition_Name__c Record Files Definition used to render the page.
Viewed__c Number of times the shared file view was opened.
Downloads__c Number of download events.
Merges__c Number of merge events.
Last_IP_Access__c IP address of the most recent access.

Field history tracking is enabled on the object. To revoke a link, clear Active, set Expires On in the past, or delete the File Share record.

Notifications

Two active packaged Flows support recipient notifications:

Deactivate these Flows and replace them with your own automation if branded email templates or a different delivery channel are required.

Set up the public site

  1. Assign ShareFilesExternally to every internal user allowed to create links.
  2. On each Salesforce Site that users can select, grant the Guest User profile access to the b3o.SharedFiles Visualforce page.
  3. Grant the Guest User profile access to these Apex classes: b3o.GlobalRemotingRouter, b3o.RemoteRecordFilesController, b3o.Shared and b3o.RemoteSchemaManager.

No guest object permissions are required. Access through the public page is limited by the share's Active setting, expiry, optional token and selected files.

Troubleshooting

Symptom Check
Link generation says the user does not have permission Assign the ShareFilesExternally custom permission.
No public sites are offered Confirm that at least one Salesforce Site is active and the user can read Site records.
A fresh link is reported as invalid Confirm that the selected site's Guest User has the required Visualforce page and Apex class access.
A previously working link is invalid Check the File Share's Active and Expires On values, and confirm all shared files still exist.
The recipient did not receive email Confirm that Shared With Contact is populated, the Contact has an email address, and the notification Flow is active.