Event Handling
Overview
On this page, we introduce how handlers can be attached to various kintone events. The different types of kintone events are listed in the side menu.
Register Event Handlerskintone.events.on(type, handler)
Function
kintone.events.on(type, handler)
Parameters
PARAMETER | VALUE | REQUIRED | DESCRIPTION |
---|---|---|---|
type | A string or an array of strings | Yes | The event type or array of event types, to which the event handler will bind to. |
handler | Function(Object) | Yes | The handler that will run when the event is triggered. All event objects have an event type in their type property. By returning a kintone.Promise object* in the event handler, the next operations can be processed after waiting for asynchronous processes in the event handler to finish: -Record List Events: *A kintone.Promise object is an object that holds a "then" method. - Reference(External site) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise |
Response
None
Sample
Delete a Handler from an Event Typekintone.events.off(event, handler())
Function
kintone.events.off(event, handler(event))
Parameters
PARAMETER | VALUE | REQUIRED | DESCRIPTION |
---|---|---|---|
event | String or Array of Strings | Yes | The event type or array of event types, to which the event handler is bound to. |
handler(event) | Function(Object) | Yes | The event handler that will be deleted. Specify the same object that was used when registering the event handler. |
Response
True, if any of the event handlers were successfully deleted.
False, if the specified event handlers could not be found.
Sample
Delete all Handlers from an Event Typekintone.events.off()
Function
kintone.events.off(event)
Parameters
PARAMETER | VALUE | REQUIRED | DESCRIPTION |
---|---|---|---|
event | String or Array of Strings | Yes | The event type or array of event types, to which the event handlers are bound to. |
Response
True, if any of the event handlers were successfully deleted.
False, if the specified event handlers could not be found.
Sample
Delete all Event Handlerskintone.events.off()
Function
kintone.events.off()
Response
True, if any of the event handlers were successfully deleted.
False, if the specified event handlers could not be found.
Limitations
- Can be used on both Desktops and Mobile.
- Cannot be used on apps attached to bodies of Spaces/Threads/Announcements.
- If there are multiple categories with the same name within the same App, at any of the following events, when returning an object containing the category property, an unintended category may be returned. To avoid this, return the object after deleting the category property.
Events:
- app.record.create.submit
- app.record.create.change.<field code>
- app.record.index.edit.submit
- app.record.index edit.change.<field code>
- app.record.edit.submit
- app.record.edit.change.<field code>
- app.record.detail.process.proceed
- mobile.app.record.create.submit
- mobile.app.record.create.change.<field code>
- mobile.app.record.edit.submit
- mobile.app.record.edit.change.<field code>