Record context & hooks

render gets the record's context, and onTrigger gets it as record (with ui). objects: ['job'] gives a JobContextV1.

FieldMeaning
object, recordId, titleWhich record this is
statusThe translated text, for display
statusKeyThe stable code. Compare statusKey, never status.
customerNameFilled on job, invoice, quote, contract and asset pages; '' elsewhere
locale, timezoneThe user's locale and timezone
userid, name, email, role, dateFormat, timeFormat
companyid, 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>;
}

Did this page help you?