You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

Global events are used as a trigger that executes different client scripts. These scripts may call various actions, for example, to open the created record.

afterLoadBreadcrumbs


The event happens after the breadcrumbs are loaded.

Return:

TypeDescription
Object

This method returns a __ object.

{
    'currentNode': {
        title: 'current Title',
        url: '/current',
    },
    'previousNode': {
        title: 'previous Title',
        url: '/previous',
    },
}

Example:

on
SimpleEventBus.on('afterLoadBreadcrumbs', async (obj) => {
   const backUrl = obj.previousNode.url; 
});

afterLoadWidgets


The event happens when all widgets are loaded.

Return:

TypeDescription
BooleanThe event returns the boolean value (true or false).

Example:

on
SimpleEventBus.on('afterLoadWidgets', async (obj) => {
    if (obj.name === 'active' && obj.isValid) {
		... // do something
		}   

});

afterSaveEvent


The event happens after the form is saved.

Return:

TypeDescription
Object

This method returns a form object

{payload {
    view: 'default',
    tableName: 'task',
    recordId: '1000000001',
    displayValue: 'Test Task',
	}
    result: 'OK',
}

or an error.

{payload{
    errors: ['Text error'],
	}
    result: 'ERROR',
}

Example:

on
SimpleEventBus.on('afterSaveEvent', async (obj) => {
  const savedRecordId = obj.payload.recordId;
});

afterSaveAndGetUiActionsEvent


The event happens after the form is saved and when the UI-actions are returned.

Return:

TypeDescription
Object

This method returns a form object

{payload: {
    view: 'default',
    tableName: 'task',
    recordId: '1000000001',
    displayValue: 'Test Task',
	}
 result: 'OK',
}

or an error.

{payload {
    errors: ['Text error'],
	}
 result: 'ERROR',
}

Example:

on
SimpleEventBus.on('afterSaveAndGetUiActionsEvent', async (obj) => {
   const savedRecordId = obj.payload.recordId; 
});

afterValidation


The event happens after the widget field validation. It is used in combination with the validation event.

Return:

TypeDescription
Boolean

The event returns the boolean value (true or false).

{
    name: 'columnName',
    isValid: true,
}

Example:

on
SimpleEventBus.on('afterValidation', async (obj) => {
    if (obj.name === 'active' && obj.isValid) {
		...
		}

});

validation


The event calls the validation of fields. 

Return:

TypeDescription
List of fieldsThe event returns the list of fields.

Example:

on
SimpleEventBus.emit('validation', fields);

  • No labels