Record files (file manager)

Record files (file manager)

What it is

Record Files is a configuration-driven file manager in 3B Onboarding (b3o). Pointed at a context record (almost always a candidate Contact), it renders the Salesforce Files attached to that record and the files attached to configured related child records (Certificates, Document Traces, and any other object with a lookup back to the context), all in one filterable list. From that single screen a user can search, filter by source, classify, preview, upload, edit, bulk-download as a zip, merge selected files into a single PDF, delete, and share selected files securely with external recipients.

It is used across every vertical b3o serves, Healthcare (licences, right-to-work, mandatory-training certificates), Education (DBS/background-check evidence, safeguarding certificates), Blue-collar and Misc (tickets, inductions, signed contracts). What the component shows and what a user can do is defined entirely in configuration, not in code, so the same component drives every use case.

The problem it solves

A candidate's evidence in a staffing org is scattered. Some files hang directly off the Contact, others hang off Certificate records, off generated/signed document records, off an Application. The stock Files related list shows only the files linked directly to one record, has no classification or filtering, cannot aggregate across related records, cannot merge or bulk-export, and cannot be safely exposed to a portal guest.

Record Files gives a compliance specialist a single, filterable view of everything reachable from a candidate: "show me this candidate's files plus their licence certificates plus their signed contracts", then "select all and export as one PDF" or "zip them". Because every source, column, upload field and permission is defined in a metadata record and enforced on the server, the same component is safe to hand to an internal specialist and to a candidate in a portal or Experience Cloud site.

Who uses it

How it is surfaced

Record Files is hosted by a Visualforce page and can be embedded through a native Lightning component, a 3B Portals block, or a Digital Experience. Pick whichever matches where the user lives. Each placement takes the same handful of inputs: which context record, which definition, and (for guests) a session key.

Placement What to use
Visualforce page The managed b3o__RecordFiles Visualforce page hosts the app directly. URL parameters: id (context record Id), definition (the definition DeveloperName), sessionKey (guest token), theme-type. Example: /apex/b3o__RecordFiles?id=003...&definition=Compliance_Export. Use this when you want a standalone URL.
Lightning App Builder / record page / Community page The native 3B Record Files Lightning component. Its placement targets are Lightning record pages and Community/Experience pages. Drop it on a Contact record page for internal specialists, or on an Experience Builder page for community candidates. Properties in the table below.
3B Portals The b3p__Portal_Block.Record_Files portal block (web component tag record-files). Drag it onto a Portals page; the guest session key is injected automatically. Traits below.
Digital Experience Embed the Visualforce page (or the native component) in an Experience Cloud page. With no explicit record context, the component resolves the running user's Contact automatically.

Native component properties (3B Record Files)

Property Purpose
Definition Name DeveloperName of the b3o__Record_Files_Definition__mdt record to use. Blank falls back to the definition named Default.
Context Path Field path from the current record to the context record's Id (for example b3o__Candidate__c on an Application record page, so the component shows the candidate's files even though it sits on the Application). Blank uses the current record itself; in a community with no record it falls back to the running user's Contact.
Frame Height Height of the embedded frame in pixels (default 800).

Portal block traits

Trait Purpose
record-id The context record Id. Defaults to {{contactUser.Id}} (the portal's resolved contact).
session-key Guest session token. Leave blank when the page already carries the token in its URL or browser storage.
definition-name The definition DeveloperName. Blank falls back to Default.
theme-type Light/dark presentation.

The server pins a guest to the Contact in the validated session key regardless of the supplied record-id.

Configuration

All behaviour lives in one custom metadata type: b3o__Record_Files_Definition__mdt, in its b3o__JSON__c long-text field. One metadata record is one behaviour profile: its own sources, columns, upload form, permissions and behaviour flags.

The JSON is interpreted entirely on the server. The client never sends SOQL; every configured field path and object name is identifier-validated before use, all values travel as binds, and the sensitive keys (ignoreSharing, fileFilter, childFilter, shareContactFilter) are stripped from the setup response so the browser never sees them.

Full JSON shape

{
  "sources": [ /* where files come from: required (see below) */ ],
  "columns": [ /* table columns (see below) */ ],
  "groupBy": "b3d__Class__c",              // optional classification filter field
  "recordFormFields": [ /* upload/edit form AND the write gate (see below) */ ],
  "recordFormFieldsSettings": { "columns": "grid-cols-2" },  // form grid layout
  "permissions": { /* user-derived or custom (see below) */ },
  "allowOcrFile": false,                   // enable AI metadata suggestions on single-file uploads
  "ignoreSharing": false,                  // see "Sharing" below
  "shareContactFilter": "RecordType.Name = 'Client'", // optional external-share recipient filter
  "behaviour": {
    "mergedFileName": "Merged Documents",  // default name for a merged PDF
    "acceptedFileTypes": ".pdf,.png,.jpg,.docx",  // limits the upload file picker
    "maxFileSizeMb": 25,                   // rejects larger uploads
    "shareUploadsWithAllUsers": true       // makes uploaded files visible to all users
  }
}

sources (required): context files and child-record files

An ordered list. Each source becomes a filter chip in the UI with a live count, and each file row shows which record it came from. If the same file is reachable through more than one source, it is shown once (the first source in the list wins).

Key Applies to What it does
name all Internal id for the source (used as the chip key).
label all Chip label shown to the user.
translationKey all Optional i18n key for the chip label.
childObjectName child sources API name of the child object to pull files from (for example b3f__Certificate__c). Omit for the context record's own files.
childRelationshipField child sources API name of the lookup on the child that points back at the context record (for example b3f__Contact__c).
childFilter child sources Optional extra WHERE clause on the child query (for example b3f__Type__c = 'License'). Admin-authored only.
titleFieldPath child sources Field on the child used as the row's "came from" label. Defaults to Name.
fileFilter all Optional extra WHERE clause appended to the file query (for example FileType = 'PDF', or a classification filter on the file's latest version). Admin-authored only.

childFilter and fileFilter are admin-authored SOQL fragments that live only in the metadata record. They are rejected if they contain a semicolon, and they support the :contextId bind token. All field paths and object names in a source (childObjectName, childRelationshipField, titleFieldPath) must be plain identifiers or dotted paths, or the request is rejected.

columns

An ordered list of file field paths to show as table columns. Reference paths are supported (for example ContentDocument.Title, Owner.Name). Labels default from the field describe unless overridden.

Key What it does
fieldPath The file field to display.
type Optional render hint: text, date, datetime, number, badge, fileSize. Inferred from the field describe when omitted.
labelOverride Optional column header text.
translationKey Optional i18n key for the header.

groupBy (optional)

A single field path used as the classification filter in the UI, so users can slice the list by a class/category value (for example b3d__Class__c).

recordFormFields: the upload/edit form and the write gate

This is the form shown when a user uploads a new file or edits an existing one, and it is also the server-side write gate: any field a user tries to write that is not declared here is rejected. This is the field-level security equivalent for elevated portal guests, so treat this list as the authoritative statement of what a user may write to a file.

Each entry supports:

Key What it does
field The file field API name (for example Title, Description, b3d__Class__c).
type The input type: field-text, field-select, field-text-area, field-checkbox, field-number-input, field-date-input.
required true/false, or a rule condition object (required only when the record meets the condition).
disabled true/false, or a rule condition object.
hidden Hide the field from the form.
default A default value.
showOptionIf Filters a select's options against the in-progress record.
labelOverride / translationKey Field label text / i18n key.
columns Grid span for the field (for example col-span-2).
isSeparator / label A layout-only separator row with a heading.

Dependent picklists cascade automatically. When the target file fields have Salesforce field dependencies configured (the classic Class then Category then Subcategory cascade), the component detects and applies them with no extra configuration. In the upload and edit dialogs, each picklist menu opens beneath its field and matches the field width, including Class and Category. recordFormFieldsSettings.columns sets the overall grid layout of the form.

AI suggestions during upload

Enable allowOcrFile in the definition and add an aiPrompt to each upload field you want AI to populate. In the upload dialog, select one file and choose Parse file with AI. Review the suggested values before saving. For provider settings and a field example, see Parse uploaded files with AI.

ignoreSharing: sharing enforcement

Value Behaviour
false (default) File and child queries respect the running user's sharing. A user only sees files they already have access to.
true Queries ignore the running user's sharing. Use this only when the placement must show files the running user would not otherwise see. Always pair it with a scoping fileFilter, otherwise every file linked to the context and its children is exposed.

ignoreSharing, fileFilter and childFilter never leave the server, they are stripped from the setup response.

permissions: user-derived vs custom

"permissions": {
  "mode": "user",           // "user" or "custom"
  "canUploadFile": true,
  "canEditFile": true,
  "canDeleteFile": true,
  "canDownloadFile": true,
  "canBulkDownload": true,
  "canMergeFiles": true,
  "canPreviewFile": true
}

The resolved permission booleans are returned to the UI (which hides the actions a user is not allowed to take) and re-checked on the server on every upload, edit and delete, so a hand-crafted request cannot bypass them.

Annotated example: a compliance export profile

This is the "collect and export everything for a candidate" setup: the candidate's own files, their licence certificates, and their signed contracts, all in one list to select-all and merge or zip.

{
  "sources": [
    // The candidate Contact's own files, only classified ones
    { "name": "contact", "label": "Candidate Files",
      "fileFilter": "ContentDocument.LatestPublishedVersion.b3d__Class__c != null" },

    // Files on the candidate's Certificate records that are licences
    { "name": "licences", "label": "Licences",
      "childObjectName": "b3f__Certificate__c",
      "childRelationshipField": "b3f__Contact__c",   // lookup on Certificate -> Contact
      "childFilter": "b3f__Type__c = 'License'",
      "titleFieldPath": "Name",
      "fileFilter": "FileType = 'PDF'" },

    // Files on the candidate's signed document records
    { "name": "contracts", "label": "Signed Contracts",
      "childObjectName": "b3d__Document_Trace__c",
      "childRelationshipField": "b3d__Contact__c",
      "childFilter": "b3d__Status__c = 'Signed'" }
  ],

  "columns": [
    { "fieldPath": "Title" },
    { "fieldPath": "b3d__Class__c", "type": "badge" },
    { "fieldPath": "b3d__Category__c" },
    { "fieldPath": "b3d__Expiration_Date__c", "type": "date", "labelOverride": "Expires" },
    { "fieldPath": "CreatedDate", "type": "datetime" }
  ],

  "groupBy": "b3d__Class__c",

  "recordFormFields": [
    { "field": "Title", "type": "field-text", "required": true, "columns": "col-span-2" },
    { "field": "b3d__Class__c", "type": "field-select" },
    { "field": "b3d__Category__c", "type": "field-select" },
    { "field": "b3d__Subcategory__c", "type": "field-select" },
    { "field": "b3d__Date_Issued__c", "type": "field-date-input" },
    // Expiry required only when the class is Licenses
    { "field": "b3d__Expiration_Date__c", "type": "field-date-input",
      "required": { "condition": { "allOrSome": "all", "selectors": [
        { "field": "b3d__Class__c", "operator": "equals", "value": "Licenses" } ] } } },
    { "field": "Description", "type": "field-text-area", "columns": "col-span-2" }
  ],
  "recordFormFieldsSettings": { "columns": "grid-cols-2" },

  "permissions": { "mode": "user" },

  "ignoreSharing": false,

  "behaviour": {
    "mergedFileName": "Candidate Compliance Pack",
    "acceptedFileTypes": ".pdf,.png,.jpg,.docx",
    "maxFileSizeMb": 25,
    "shareUploadsWithAllUsers": true
  }
}

A candidate read-only variant is the same file, with permissions switched to { "mode": "custom", "canDownloadFile": true, "canPreviewFile": true } and the write form trimmed or removed.

The packaged Default example references the 3B CLM classification fields on the file record (b3d__Class__c, b3d__Category__c, b3d__Subcategory__c, b3d__Date_Issued__c, b3d__Expiration_Date__c), so 3B CLM must be installed to use it as-is. If you do not run 3B CLM, clone the definition and swap in your own file fields.

What users can do

Access and the guest/session model

Record Files is a session app. Two access modes:

Additional server-side guards, all enforced regardless of what the browser sends:

The core file manager is a synchronous request/response tool. External sharing adds packaged notification Flows for a newly created link and a rotated access token. See External file sharing for their setup and replacement options. Any other downstream automation is whatever your org already has on Files or on the child objects.

Remember to grant any new objects or fields you introduce (custom file fields, new child objects) on the Onboarding_Admin_Full_Permission permission set, which also grants access to the Record Files server class.