Skip to content

Commit 5ccab09

Browse files
committed
docs(forms): a public form needs both sharing switches (WIP)
Claude-Session: https://claude.ai/code/session_018zT8d8NpiQ1ExhuNd5TxY6 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 618a3d9 commit 5ccab09

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎content/docs/ui/forms.mdx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Both modes:
2020
- Honor `?prefill_<field>=<value>` URL params
2121
- Honor `submitBehavior` (thank-you / redirect / continue / next-record) — with **mode-aware defaults** when it is omitted (see [§8](#8-submitbehavior--what-happens-after-submit))
2222

23-
A **public form** is the Salesforce *Web-to-Lead* style embeddable form — declare a `FormView` with `sharing.allowAnonymous: true`, give it a `publicLink`, and the framework wires the anonymous REST endpoints automatically.
23+
A **public form** is the Salesforce *Web-to-Lead* style embeddable form — declare a `FormView` with `sharing.enabled: true` and `sharing.allowAnonymous: true`, give it a `publicLink`, and the framework wires the anonymous REST endpoints automatically. Clearing either switch withdraws the form from every anonymous endpoint.
2424

2525
## Architecture at a glance
2626

@@ -86,7 +86,7 @@ export default defineView({
8686
},
8787
],
8888
sharing: {
89-
enabled: true,
89+
enabled: true, // ← required (the schema default is false)
9090
allowAnonymous: true, // ← required
9191
publicLink: '/forms/contact-us', // ← the slug ":contact-us" wires this view to the public route
9292
},
@@ -99,7 +99,7 @@ export default defineView({
9999
> - The slug in `publicLink` (`contact-us`) becomes the `:slug` segment in the REST URL.
100100
> - Anything not in the `sections[].fields[]` whitelist is silently stripped at submit time. Treat the whitelist as the form's authoritative "what the public is allowed to set" list.
101101
> - A form whose sections declare **no** fields collects nothing, so the submit is **refused** (`400 VALIDATION_ERROR`) rather than accepting whatever the caller sent (#6920). Its `GET /forms/:slug` publishes no schema either (#6601) — declare the fields and both planes come alive together.
102-
> - Multiple form views per object are fine — only the one(s) with `sharing.allowAnonymous === true` are exposed.
102+
> - Multiple form views per object are fine — only the one(s) with `sharing.enabled === true` and `sharing.allowAnonymous === true` are exposed.
103103
104104
## 2. (Optional) Create the `guest_portal` permission set
105105

@@ -230,7 +230,7 @@ Errors:
230230
| `400 VALIDATION_ERROR` | the form's sections declare **no** fields, so it collects nothing — wire the fields and resubmit (#6920) |
231231
| `400 VALIDATION_FAILED` | object schema validators fail (`required`, `format`, `length`, …) |
232232
| `403 PERMISSION_DENIED` | the resolved profile does not allow create on the target object |
233-
| `404 FORM_NOT_FOUND` | slug not registered on any `sharing.allowAnonymous: true` view |
233+
| `404 FORM_NOT_FOUND` | slug not registered on any view whose form has `sharing.enabled: true` and `sharing.allowAnonymous: true` |
234234
| `5xx` (generic) | driver / hook threw — submit errors are mapped by `mapDataError`; there is no dedicated `FORM_SUBMIT_FAILED` code |
235235

236236
The companion `GET /api/v1/forms/:slug` route returns `500 FORM_RESOLVE_FAILED` if form resolution itself throws.

0 commit comments

Comments
 (0)