You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 24 Next »
Global events are used as a trigger that executes different client scripts. These scripts may call various actions, for example, to open a created record.
The event occurs after the breadcrumbs are loaded.
Return:
This method returns nodes URL.
{ 'currentNode': { title: 'current Title', url: '/current', }, 'previousNode': { title: 'previous Title', url: '/previous', } }
Example:
SimpleEventBus.on('afterLoadBreadcrumbs', async (obj) => { const backUrl = obj.previousNode.url; });
The event occurs when all widgets are loaded.
SimpleEventBus.on('afterLoadWidgets', async (obj) => { if (obj.name === 'active' && obj.isValid) { // do something } });
The event occurs after a form is saved.
This method returns a form object
{ "payload": { "view": "Default", "tableName": "task", "recordId": "166307559406494736", "displayValue": "" }, "result": "OK" }
or errors
{ "payload": { "errors": [...] }, "result": "ERROR" }
SimpleEventBus.on('afterSaveEvent', async (obj) => { const savedRecordId = obj.payload.recordId; });
The event occurs after a form is saved and when UI-actions are returned.
This method returns a form object.
or an error.
SimpleEventBus.on('afterSaveAndGetUiActionsEvent', async (obj) => { const savedRecordId = obj.payload.recordId; });
The event occurs after the widget field validation. It is used in combination with the validation event.
The event returns a boolean value (true or false).
{ name: 'active', isValid: true, }
SimpleEventBus.on('afterValidation', async (obj) => { if (obj.name === 'active' && obj.isValid) { // do something } });
The event calls the validation of fields.
SimpleEventBus.emit('validation', fields);