Record context & hooks
render gets the record's context, and onTrigger gets it as record (with ui). objects: ['job'] gives a JobContextV1.
| Field | Meaning |
|---|---|
object, recordId, title | Which record this is |
status | The translated text, for display |
statusKey | The stable code. Compare statusKey, never status. |
customerName | Filled on job, invoice, quote, contract and asset pages; '' elsewhere |
locale, timezone | The user's locale and timezone |
user | id, name, email, role, dateFormat, timeFormat |
company | id, name, timezone, currency, country |
Hooks
Inside any component of an extension, useRecord(), useUser() and useCompany() return the same data, and useZuperApi(), useUi() and useServer() return the host calls, so you don't pass them down through props.
import { Text, useRecord } from '@zuperpro/app-sdk/react';
function JobStatus() {
const job = useRecord();
return <Text variant="muted">{job.status}</Text>;
}Updated about 1 hour ago
Did this page help you?
