f365.nav, navigation
goTo, goBack, refresh, redirectAfterSave, closeForm, manage navigation in and out of the form.
The f365.nav namespace controls navigation: where the user goes after
submit, how to programmatically leave the form, how to refresh.
Surface
| Property | Description |
|---|---|
goTo(url, opts?) | Navigate immediately. Skips save-flow integration; use when the user has consciously chosen to leave. |
goBack() | Browser back. |
refresh() | Reload the current page. |
redirectAfterSave(url) | Single-shot. Fires after onSave handlers run. The form runtime ensures all post-save writers finish before navigating. |
closeForm() | In SPFx form customizer context, calls SP's built-in formClosed(). Outside SPFx, falls back to onCancel. |
Examples
Redirect to a custom thank-you page after submit
f365.events.onSave(({ itemId }) => {
f365.nav.redirectAfterSave(`/SitePages/thank-you.aspx?ref=${itemId}`);
});
Send the user to a related form
f365.control('CreateInvoiceBtn').on('click', () => {
f365.nav.goTo(`/Lists/Invoices/NewForm.aspx?orderId=${f365.context.itemId}`);
});