CRUD Hooks

12-11-2018
Before saving: ---------- ```typescript function init() { let pm = runtime.context.pluginManager; if (pm) { pm.addHook("amura.bookings.onSave_reservation", onSaveReservation) } } function onSaveReservation(r: Reservation) { } ``` You can abort the operation by throwing an exception. Before deleting: -------- ```typescript function init() { let pm = runtime.context.pluginManager; if (pm) { pm.addHook("amura.bookings.onDeleting_reservation", onDeleteReservation) } } function onDeleteReservation(ids: number[]) { } ``` The argument is the array of id's being deleted. You can abort the operation by throwing an exception.
Hooks Backend CRUD