domain: client
language: javascript
class AbstractItem
Use abort method to throw exception.
It can be usefull when you need to abort execution of some ‘on_before’ events.
The following code will throw exception with the text:
execution aborted: invoice_table - a quantity value is required
function on_before_post(item) {
if (item.quantity.value === 0) {
item.abort('a quantity value is required');
}
}