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)
|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.
It accepts a single parameter, which is the Event object that contains information of the triggered event.
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)
Remove Event Handlers kintone.events.off(type, handler)
|type||String or Array of Strings||The event type(s) to which the event handler is bound to.|
|handler||Function(Object)||The handler that will be removed from the specified event type(s).
If no value is set for this parameter, all event handlers will be removed from the specified event type(s).
If no values are set for both the type and handler parameter, then all event handlers will be removed from all event types.
True, if any event handlers were removed.
False, if no event handlers were removed.
- 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.
- app.record.create.change.<field code>
- app.record.index edit.change.<field code>
- app.record.edit.change.<field code>
- mobile.app.record.create.change.<field code>
- mobile.app.record.edit.change.<field code>