4. Delete Record
context.deleteEntity(slug, id)
async· returnsRecord<string, any>
Deletes a record from the specified entity by its ID.
Prop
Type
context.updateComponentByName("btnDeleteSample", "loading", true);
await context.deleteEntity("samples", context.router.id);
context.updateComponentByName("btnDeleteSample", "loading", false);
context.redirect("/samples");
Returned value — an object with a values array containing the deleted record as it was before deletion. Note that SystemStatusID reflects the soft-deleted state:
{
"values": [
{
"ID": "55",
"Name": "Sample A",
"CollectedDate": "2026-02-10T08:00:00Z",
"CreateDate": "2026-02-10T08:00:00Z",
"CreateUser": { "ID": "3", "FullName": "Jane Doe" },
"ModifyDate": "2026-03-12T10:55:00Z",
"ModifyUser": { "ID": "7", "FullName": "John Smith" },
"SystemStatusID": { "ID": "3", "Name": "Soft Delete" }
}
]
}