Objects, fields, Apex classes, permission sets and URLs in your org keep their Derby Forms-prefixed API names; they appear as code literals in this guide and are explained in docs/KEPT-IDENTIFIERS.md.
This guide describes the org-free source contracts and the tasks an administrator performs after deploying the metadata and Apex classes. The source names are intentional: the builder is formBuilder, the runtime renderer is formRenderer, and the console is submissions.
1. Prepare the deployment #
- Deploy the
force-app/main/defaultsource with Salesforce CLI. - Confirm the custom objects used by the source exist:
Form__c,Form_Version__c,Submission__c,Submission_Draft__c,Form_Mapping__c, andForm_Event__c. - Confirm the fields referenced by Apex and metadata are present, including the form slug, definition JSON, version status, submission payload, idempotency key, event detail, and draft token fields.
- Assign the administrator permission set access to the
formBuilderandsubmissionsLightning components. - Do not grant guest users access to the builder or submission console.
- Before enabling guest file fields, complete the Guest file upload installation prerequisites below, including the site's Allow guest users to access public APIs preference. This prerequisite is separate from object/field access and native guest upload settings; publish the site as required.
2. Create a form definition #
- Open the Lightning page containing
formBuilder. - Choose the target object in the builder. The component calls
BuilderController.getFormandgetLimits. - Add a field definition with a stable
key, a user-facinglabel, atype, and the target field name. - Set
requiredonly when the answer must be present. The renderer reads this metadata and reports validation in its live status region. - For choice fields, add option values and labels. The definition, not a free-form guest request, controls the accepted keys.
- For a file field, configure the allowed MIME policy.
GuestSubmitControllerpermits PNG, JPEG, and PDF only. - Keep the number of fields at or below
FormLimits.MAX_FIELDS_PER_FORM(150). The builder shows a limit banner at 150 andVersionWriter.saveDraftrefuses a larger definition. - Add a rule only after the fields it references exist. Rules are evaluated by
RuleEngine. - For a Flow field, set
typetoflow,flowApiNameto the deployed Flow API name,flowInputto the Flow variable, andflowOutputto the output event key. - For translations, add
translations[locale][fieldKey]; option text can use${fieldKey}.${optionValue}. - For theme changes, use
theme.tokensandtheme.darkTokens. These become renderer CSS custom properties; they are not arbitrary style markup. - Save the version as a draft. Do not edit the published version in place.
3. Map answers to Salesforce objects #
- Open the mapping section for the form version.
- Select Insert, Update, or Upsert in the mapping record.
- For each answer key, select the destination field on the target object.
- For Upsert, select the external ID field.
- Put parent mappings before child mappings when a child requires the parent record id.
- Keep mappings inside the object and field allow-list used by
SubmissionService. - Review CRUD/FLS permissions before enabling the mapping. The write path uses
Security.stripInaccessibleand must remain the only insertion path. - Save the mapping and test it with a non-guest authenticated submission before publishing.
4. Configure guest protection #
- In the published definition, enable the guest policy only for fields that are safe to receive anonymously.
- Set per-form native honeypot, minimum fill time (default 3 seconds), and optional email verification in the builder. Verify org email deliverability before enabling email verification.
- Guest lookup search needs a complete explicit allow-list (ISF-010):
lookup.guestSafe = true,lookup.guestObjectsnaming the target object andlookup.guestDisplayFieldsnaming the display field.GuestSecurityLinterreportsLOOKUP_EXPOSUREfor a searchable lookup without that allow-list, and publish refuses it on a public form. - Confirm the target object and fields are in the guest allow-list.
- Confirm the request body stays under
FormLimits.MAX_PAYLOAD_BYTES(512 KiB). - Confirm each submission stays at or below 5 files and 10 MiB per file.
- Confirm the 30-submission counter window per hashed request-address/form. Aura requests without
RestContext.requestshare one bucket per form, not one per client IP; verify the deployed route's effective rate behavior before public launch. - Never put provider secrets or signing material in a definition, LWC property, log message, or source-controlled JSON.
5. Validate and publish #
- In the builder, save the draft.
- Run the guest security linter through the builder's scan action.
- Read every finding, not only the first error.
- Fix ERROR findings by changing the definition or its policy, then save a new draft.
- Re-run the scan and verify the result is clean.
- Publish the selected version through the builder's publish action.
- Publishing retires the previous published version and activates the selected version.
- Record the published version id and definition hash in the release record.
- Keep the previous version available for rollback; do not delete it as part of normal publishing.
6. Embed the form #
- In the builder's Publish section, open Share and embed. The panel provides the per-form embed settings, a ready-to-copy script-based snippet, and the Experience portal URL. See
docs/share-embed.mdfor setup, permissions, readiness checks, and troubleshooting. - Configure an Experience site and add the Derby Forms Guest Host component to one page. Either set its Public Form Slug to the form's published slug, or turn on Take the form from the page address so that one page serves every public form (see
docs/guest-host.md, one-time administrator setup). The panel's portal URL is distinct from the embed runtime site's base URL; use each only for its stated purpose. - Copy the generated snippet from the panel rather than hand-writing it or calculating its asset hash. Re-copy it after renderer upgrades.
- Confirm the host page CSP allows the configured origin and the guest policy and per-form native controls before opening the URL publicly.
- Test keyboard navigation, validation, submission status, and the failure path from the public URL.
- Do not expose fields outside the published definition. Guest lookup search is allowed only with the explicit allow-list in section 4 step 3.
Publish a hosted public form (builder path) #
After an administrator has set up the site once (see docs/guest-host.md), a builder who holds only the Derby Forms builder and embed permissions publishes the form, marks it public, opens Publish → Share and embed and copies the Derby Forms hosted link. No Experience Builder access, admin step or site republish is needed per form. Public forms use a free Experience Builder site in your own org (Enterprise, Unlimited, Performance and Developer editions); guests use no licence.
Grant-linked embed prefill (v2) #
- Publish the form and its Experience site (Share and embed panel, Embed runtime site).
- Add the host page origin, exactly as
https://host, to the org CORS allowlist (CorsWhitelistOrigin). Without it the browser blocks the prefill POST. - An authorised admin issues a grant for one source record with
EmbedPrefill.issue(formId, recordId, origin, lifetimeMinutes), between 1 and 60 minutes. Pass the bearer to the host page as the URL fragment#derby-prefill=<bearer>. Grants are single-use. - If the guest sees "Prefill is unavailable", issue a new grant. A 403 from the prefill route means an expired or used grant, a wrong origin or form, or a missing signing secret.
7. Drafts and resume links #
- An authenticated user with
Runtimemay select Save draft in the renderer. Guests can also save and resume on a public form:GuestDraftControllerissues a one-use private resume link (a bearer credential) after org-signed render proof and a per-client guest quota. The Submission Console's Partial submissions tab lists saved progress read-only and never shows resume links. - A trusted enclosing host handles
draftsavedand delivers its signed token to that same owner without logging it or storing it in the browser. - On return, the host calls
renderer.resumeDraft(token)once. The renderer usesDraftHostController.resume, checks the form slug and applies the returned answers.Derby Forms: Prefillverifies and consumes a signed token, returning only its context; it does not load a persisted draft. Never pass a draft token through Prefill first, because that consumes its one use. - Expired, malformed, or previously used signed tokens must fail closed. Issue a new token rather than weakening verification.
- Draft ownership and sharing still require org configuration; source code alone cannot prove the deployed permission model.
8. Monitor submissions #
- Open
submissions. - Review the list returned by
SubmissionConsoleController; the console returns at mostFormLimits.CONSOLE_ROWS(200) rows per query. - Open the submission event detail and error message before replaying.
- For a Failed original, enter complete corrected answers/repeats JSON in the admin console and confirm the new write. Failed request contents were rolled back, so they cannot be automatically replayed; file retry is unsupported. Do not use a failed retry child as a new root.
- Verify the new submission is Written and the original is Replayed; a failed corrected attempt leaves the original Failed. Record both ids.
- Check the related
Form_Event__crecords for validation, mapping, and post-submit events. - Escalate a repeated failure with the form slug, version id, submission id, event detail, and trace record id. Do not include secrets or full guest tokens.
9. Flow and Apex record-link recipes #
Submission__c.Status__c is the first-class lifecycle field. A submission record is linked to every mapped record through Submission_Record__c; its Record_Id__c preserves the Salesforce id as text, while standard-object lookup fields expose Lead, Contact, Account, Case, or Opportunity related lists. Custom targets use Record_Id__c and Object_API_Name__c.
- Build a record-triggered Flow on
Submission__c, after save, whenStatus__cchanges toWritten. - At that point the child link rows,
Primary_Record_Id__c,Primary_Object__c, andRecord_Count__chave already been written in the same Apex transaction. Use the primary id/object for the common single-record path; for all outputs, call the Apex actionDerby Forms: Get Submission Recordswith the submission id. - To react from any mapped target record, call
Derby Forms: Get Submissions For Recordwith the triggering record id. Both actions return only records the running user can read. - Use a platform-event-triggered Flow subscribed to
Submission_Received__eto react to Written or Failed. The event carries submission id, form slug, status, and the primary record id when one exists. Re-query only if more data is required. - Do not call an external endpoint from Derby Forms. SMS/e-sign are subscriber-owned Flow actions and are outside the Derby Forms transaction.
Status_Changed_At__c,Written_At__c, andFailed_At__cprovide transition timestamps;Error_Code__cis a stable category, whileError_Message__cis sanitized operator guidance.
Report folder access #
The report folder must not be shared to All Internal Users. In a Derby Forms development org, the Analytics Folder Shares GET for Derby_Reports initially returned no shares for the Standard User probe; the Admin and Runtime probe principals already had view-only shares. A temporary view-only direct share to the Standard User enabled actual report execution and one visible result (matrix/f3-standard-user-report-20261029.json); the temporary share was deleted and GET readback confirmed it absent. The ReportFolder metadata deploy accepted accessType=Shared, but SOQL continued to report AccessType=Hidden; therefore do not treat that metadata value as proof of effective access or claim reusable role/permission-set group provisioning. For a subscriber install, an administrator must create/maintain a report-consumer public group containing only authorized Builder/Runtime users and grant that group view access to the report folder, then verify with a non-admin user. Per-user runtime access is now proven; install-time reusable group provisioning remains unverified.
10. Record page visibility #
Add the App Builder component recordSubmissions to the assigned Lead, Contact, Account, and Case Lightning record pages; for a custom object, add it to that object's record page. It accepts the current recordId, uses a user-mode query and returns only submissions visible to the running user through record sharing and field access. The linked-submission visibility contract is record-scoped: an authorized owner can see submissions linked to records they can access; unrelated records must not expose them. Do not grant broad Submission sharing to make this component populate.
The current Derby Forms application has app-specific View overrides for Lead (Submission_Link_Probe), Contact (Contact_Submissions), Account (Account_Submissions), Case (Case_Submissions), and the test master-detail pair (Test_Parent_Submissions, Test_Child_Submissions). The four standard page layouts now include the typed Derby Forms Submissions related list via Submission_Record__c.<Lead|Contact|Account|Case>__c; their app record pages include force:relatedListContainer plus the generic component. Browser reads show one linked submission in both the typed native list and the generic component on Lead, Contact, Account, and Case. The custom test parent/detail pages show the generic component results. These assignments apply only in the Derby Forms app, not as org defaults, and screenshots were captured under the Salesforce CLI admin principal; Standard User owner/denial behavior is separately covered by System.runAs tests (see F3 receipts). In App Builder, select the target object and assigned Lightning page, add Derby Forms Record Submissions, save, activate for the intended app/profile/form factor, then verify both an authorized owner and a user without access to the linked record. For customer custom objects, use the generic component because no typed lookup is defined; no target-specific Apex is needed. Do not grant broad Submission sharing to make the component populate.
Each submission row has a View submission action that opens a read-only, printable viewer built from the saved answer snapshot. Answers are grouped under the form's section headings in their original order; file answers show the stored file name and link only when the user can see that file through the submission. The same list and viewer are also available as the record action View Derby Forms Submissions (submissionsQuickAction). It is on the Lead, Contact, and Account page layouts and on the Derby Forms app record pages, which include a highlights panel. On the Derby Forms app's Case record page (Case_Submissions) the action is a Dynamic Action on the highlights panel, because a feed-based Case layout sends layout actions to the feed publisher instead of the header. For other Case pages, add Case.View_Submissions to that page's highlights panel (Dynamic Actions) or the Case layout's Lightning actions yourself; adding it from the package would replace your Case actions. For a custom object, create a Lightning Web Component quick action that uses submissionsQuickAction and add it to that object's layout.
11. Release checklist #
- Validate the definition with
node scripts/derby-cli.js validate. - Review the builder security scan and resolve every ERROR finding.
- Confirm the selected version is a draft before publishing.
- Confirm the target object and every mapped field are in the approved allow-list.
- Confirm administrator and authenticated host permissions in the target org.
- Confirm the native honeypot, minimum fill time, optional email verification, per-visitor rate limit, and Strict CSP settings. Native protection needs no external credential, script, or trusted site.
- Run an authenticated test submission and inspect its event detail.
- Run a public test only after the guest policy is enabled.
- Record the version id, definition hash, and release timestamp.
- Keep the previous published version available for rollback.
- Recheck the public URL after publishing and verify the status region announces success.
- Capture the console and trace-record links in the release record.
10. Rollback #
- Stop directing traffic to the affected public URL if the form is unsafe.
- Select the last known-good draft or clone it into a new draft.
- Correct the definition or mapping; do not edit the historical published version.
- Run the guest-security scan again.
- Publish the known-good version through the normal builder lifecycle.
- Verify a test submission, the public embed, and the console event.
- Preserve the failed version and its trace records for investigation.
11. Retention and operational boundaries #
- The source does not enforce a submission retention or deletion policy.
- Configure retention in the org only after a data-owner decision and document the resulting schedule.
- The source does not enforce a repeat-group row cap or rule-depth cap; do not advertise one as a Derby Forms guarantee.
submissionsPerDayandfileSizeMbinBuilderController.getLimitsare display values; they are not a daily counter or the enforcement path.- Apex compilation, sharing, CRUD/FLS, CSP, and Flow execution require org verification.
- Keep the org-free CLI validation in CI before deploying a definition.
Setup permission and private stores #
Setup checklist, configured-state reads and signing-secret generation require Manage Derby Forms Setup (Manage_Setup), included in Builder. Without it, the message is Derby Forms setup access denied. Assign the documented admin permission set to the setup operator; never grant setup permission to a guest. Signing secrets are not returned to the browser.
Authenticated operations use user-mode access where documented. Narrow system-mode stores support private signed tokens, guest ledgers and audit persistence; they are not general permission bypasses.
Migration operator access #
Migration requires Migrate_Forms plus read access to the source/destination forms, versions, themes, mappings and fields involved. Inventory queries use Salesforce user mode (CRUD, field-level security and record access). Grant only the missing documented access to the operator; do not broaden guest access or bypass a failed check. Only the creator may discard a migration draft; otherwise the message is Only the user who created this migration can discard it. Discarding also needs delete access on the four migration draft objects. Builder already has it; a custom permission set that allowed discard without delete access is now refused, so add the delete access to that set rather than working around the refusal. A record the user cannot see can produce a generic refusal instead.
Submission search access #
The submission recovery/search console requires Replay_Failed and read access to the queried forms, mappings, submissions and retained answer fields. Searches run in user mode and respect sharing and field-level security. Missing access can deny a query rather than return partial unauthorized data. Check the operator permission set, object/field access and record visibility before retrying; never grant broad Submission sharing merely to populate a search.
Share and embed operator access #
Share and embed guest permission assignment keeps the Manage Embed/Manage Users and bound-site checks and now uses user-mode permission-set lookup and DML. The operator needs the corresponding Salesforce read/assignment access, including read access to the form being shared: the assignment reads the form with the caller's own access, so an operator without form read access is refused. Site/namespace display metadata also uses user mode; unavailable metadata falls back or fails closed. Do not grant additional setup permissions to the site guest as a workaround.
Guest file upload installation prerequisites #
Guest file upload has a site installation prerequisite: in the authenticated site Workspace, open Administration → Preferences and enable Allow guest users to access public APIs. Also enable Let guest users view asset files, library files, and CMS content available to the site for the site asset path, then publish the site as required. Separately enable Allow site guest users to upload files in Setup → Salesforce Files → General Settings and Use the File Upload Lightning web component for LWR sites for LWR uploads. These settings do not grant object/field access or bypass authorization, signed render proof/nonce, rate limits or file validation. Keep the documented guest permissions and validate both upload and final submission/file access in the intended site.
Large migration import troubleshooting #
If an import contains many distinct destination record references, planning can return split the import into smaller batches to verify destination references safely. This is a bounded capacity refusal before exhausting Salesforce query limits, not a removal of supported imports. Split the import into smaller supported batches, review each new plan and destination mapping, and retry with the same authorized migration operator. Do not bypass the resolver or broaden guest/record access; normal CRUD, field-level security and sharing checks still apply. There is no universal promised reference count: available transaction headroom and reference types vary.
Package distribution status #
Released production install: 0.1.61.2 (04taj000000sYEPAA2), install with the link we send when you request early access. The previous release was 0.1.60.1 (04taj000000sKcrAAE). Builds numbered 0.1.62.x are betas, not the production install. Namespace remains undecided. The cleanup guidance below describes this release.
Licence tab #
Admins with the Manage Derby Forms Setup permission open the Licence tab to see the tier, the end date, builder seats with the list of builders, and which features the licence includes.
Usage shared with Derby Forms. Once a day the package sends aggregate counts and dates (no form content, answers, personal data, record ids or user names) to Derby Forms through Salesforce package licensing. Sharing is part of the licence and is on by default. Derby Forms sets it on your licence; to discuss turning it off, contact Derby Forms. The tab lists every value with its current value, the value last sent and when. The daily job starts by itself the first time an admin opens this tab or a builder saves or publishes a form.
Monthly submissions. Your licence can include a monthly submission allowance set by Derby Forms (unlimited unless Derby Forms sets one). When one is set, the tab shows how many new submissions this calendar month (UTC) count against it. If the allowance is enforced and reached, new submissions are refused with "This form is not accepting responses right now." until the next month or until Derby Forms raises the allowance; resuming saved progress, retries of submissions already received, reading, exports and the submission console keep working.