3. Update Record
context.updateEntity(slug, id, payload)
async· returnsRecord<string, any>
Updates an existing record with the provided field values. Only the fields included in the payload are changed — all other fields remain untouched.
Prop
Type
context.updateComponentByName("btnApproveRequest", "loading", true);
const update = {
Status: 2
};
await context.updateEntity("timeoff", context.router.id, update);
context.updateComponentByName("btnApproveRequest", "loading", false);
context.toast.success("Request approved.");
Returned value — an object with a values array containing the updated record. Note that ModifyDate and ModifyUser are automatically updated by the platform:
{
"values": [
{
"ID": "88",
"Status": { "ID": "2", "Name": "Approved" },
"Employee": { "ID": "14", "Name": "Ana Kovač" },
"StartDate": "2026-04-01T00:00:00Z",
"EndDate": "2026-04-05T00:00:00Z",
"CreateDate": "2026-03-01T09:00:00Z",
"CreateUser": { "ID": "14", "FullName": "Ana Kovač" },
"ModifyDate": "2026-03-12T10:30:00Z",
"ModifyUser": { "ID": "7", "FullName": "John Smith" },
"SystemStatusID": { "ID": "1", "Name": "Active" }
}
]
}