UI Functions Reference
UI functions are the browser-side library available inside every UI process. Data hangs off context.sdk. Everything that touches the screen hangs off namespaced helpers on context.
const created = await context.sdk.entities.create({
params: { entitySlug: "invoices" },
json: { ClientName: "Acme Corp", Amount: 1500 }
});
context.toast.success("Invoice " + created.id + " created.");The old helpers — createEntity, getEntity, getEntities, updateEntity, deleteEntity, updateComponentByName, downloadPDF, mutate, and the rest — no longer exist, and there is no compatibility layer. Calling one fails at runtime with "is not a function". See Coming from the previous frontend at the end of this page.
Three rules that apply everywhere
SDK calls are asynchronous. Always await context.sdk.*. Toast, modal, redirect, and context.component.* are synchronous.
Do not pass appSlug. context.sdk injects the running app. A hardcoded slug breaks the moment the app is copied under a new name.
Hooks are illegal. sdkClient and React hooks cannot run inside process code. Use the imperative context.sdk (Promise-based, cache-aware).
Quick Reference
Context & Environment
The context object, event, router, user and sessions
Create Record
Insert a single record
Get Record
Read one record or a filtered list
Update Record
Partial updates to a single record
Delete Record
Delete a single record
Component Management
Read and update component props at runtime
Event
The payload that fired the process
Toast
Success, error, info and warning messages
Modal
Confirm and alert dialogs
Downloads
PDF, Word, Excel and file downloads
Navigation
Redirect to a route or URL
Router
The current URL and record ID
Cache & Invalidation
Refresh entity data after writes
Identity, State & App
User, sessions, appState and theme
Run a Backend Process
Call a business process from the UI
Every function at a glance
Data — context.sdk.entities
| Function | Returns |
|---|---|
getById({ params: { entitySlug, recordId } }) | the record (often on .data) |
getBySlug({ params: { entitySlug }, query? }) | { data, totalCount, rowCount } |
create({ params: { entitySlug }, json }) | { success, id, message } |
update({ params: { entitySlug, recordId }, json }) | { success, id, message } |
delete({ params: { entitySlug, recordId } }) | { success, id, message } |
Writes auto-invalidate the entity cache. You do not call a separate mutate helper.
UI control
| Function | Returns |
|---|---|
context.component.getByName(name) | the component |
context.component.getPropByName(name, prop) | the prop value |
context.component.updateByName(name, prop, value) | void |
context.component.updateByKey(key, prop, value) | void |
context.component.updateState(name, prop, value) | void |
context.toast.success / error / info / warning(message) | void |
context.modal.confirm / info / warning / error / success(config) | modal handle |
context.redirect(url) | void |
Documents — context.document
| Function | Returns |
|---|---|
pdf(entitySlug, recordId, templateId, fileName?, footer?, header?) | Promise<void> |
pdfWithBarCode(entitySlug, recordId, templateId, barCode, ...) | Promise<void> |
word(entitySlug, recordId, templateId, fileName?) | Promise<void> |
excel(payload, templateId, fileName) | Promise<void> |
file(url, payload, fileName) | Promise<void> |
Backend processes — context.sdk.applications
| Function | Returns |
|---|---|
runTrigger({ params: { triggerId }, json }) | { success, result, error, ... } |
triggerId is the trigger's file basename, not a numeric id.
Records
Records are flat objects keyed by column name in PascalCase. Lookup fields arrive expanded as objects rather than as bare foreign keys.
{
"ID": 84,
"ClientName": "Acme Corp",
"Amount": 1500.00,
"CreateDate": "2026-03-12T10:24:00.000Z",
"CreateUser": { "ID": 7, "FullName": "John Smith" },
"SystemStatusID": { "ID": 1, "Name": "Active" }
}When building a create or update payload, pass the lookup's .ID (a number), not the expanded object.
Coming from the previous frontend
Every helper below was part of the original UI process API and has been removed. There is no shim — a call to any of them throws.
| Previous | Now |
|---|---|
context.createEntity(slug, payload) | context.sdk.entities.create({ params: { entitySlug: slug }, json: payload }) |
context.getEntity(slug, id) | context.sdk.entities.getById({ params: { entitySlug: slug, recordId: id } }) |
context.getEntities(slug, queryString) | context.sdk.entities.getBySlug({ params: { entitySlug: slug }, query }) |
context.updateEntity(slug, id, payload) | context.sdk.entities.update({ params: { entitySlug: slug, recordId: id }, json: payload }) |
context.deleteEntity(slug, id) | context.sdk.entities.delete({ params: { entitySlug: slug, recordId: id } }) |
result.values[0] / result.values | result.data (list) or result.data ?? result (one record) |
context.updateComponentByName(...) | context.component.updateByName(...) |
context.getComponentByName(...) | context.component.getByName(...) |
context.getComponentPropByName(...) | context.component.getPropByName(...) |
context.updateComponentByKey(...) | context.component.updateByKey(...) |
context.updateComponentState(...) | context.component.updateState(...) |
context.downloadPDF(...) | context.document.pdf(...) |
context.downloadPDFWithBarCode(...) | context.document.pdfWithBarCode(...) |
context.downloadWord(...) | context.document.word(...) |
context.downloadExcel(...) | context.document.excel(...) |
context.downloadFile(...) | context.document.file(...) |
context.mutate(slug) | automatic on SDK writes, or context.sdk.invalidate.entities.getBySlug({ entitySlug: slug }) |
context.clearEntityCache() | context.sdk.invalidate.entities.all() |
context.state.foo = value | context.appState.set("foo", value) / .get("foo") |
context.primaryColor | context.app.primaryColor |
context.apiClient.post("/Trigger?id=N", body) | context.sdk.applications.runTrigger({ params: { triggerId: "filename" }, json: body }) |
create returns { success, id, message } — not the saved row. And id is lowercase; every record field everywhere else is uppercase ID.