Record List Event
Contents
-
Record List Events
- Onload Event (desktop) - app.record.index.show
- Onload Event (mobile) - mobile.app.record.index.show
- Inline Edit Event - app.record.index.edit.show
- Save Submit Event - app.record.index.edit.submit
- Save Submit Success Event - app.record.index.edit.submit.success
- Field Change Event - app.record.index.edit.change.(fieldcode)
- Delete Submit Event - app.record.index.delete.submit
- Event Limitations
- Event Object Actions
Record List Events
Onload Event (desktop) - app.record.index.show
An event triggered after the record list page is displayed on the desktop.
Function
app.record.index.show
Sample
|
|
Triggered Timing
- After displaying the record list page
- After displaying the record list page when clicking the Next or Previous arrow icons (the icons are displayed when all records cannot be fit into one page)
- After sorting the record order when clicking the field titles on the record list page
- After applying the filter settings on the record list page
- After the category is changed on the record list page
Properties of the Event Object
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
appId | Number | The App ID. |
viewType | String | The type of the record list. Possible values are list, calendar, or custom. |
viewId | Number | The View ID of the record list. |
viewName | String | The View Name of the record list. |
records | Array or Object | Differs depending on the viewType:
|
offset | Number | Differs depending on the viewType:
|
size | Number | Differs depending on the viewType:
|
date | String | Differs depending on the viewType:
|
type | String | The event type. |
Available Event Object Actions
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.
Onload Event (mobile) - mobile.app.record.index.show
An event triggered after the record list page is displayed on the mobile.
Function
mobile.app.record.index.show
Triggered Timing
- After displaying the record list page
- After displaying the record list page when clicking the Next or Previous arrow icons * Available only if the View Type is List View
- After sorting the record order when clicking the field titles on the record list page * Available only if the View Type is List View
- After the category is changed on the record list page * Available only if the View Type is List View
Properties of the Event Object
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
appId | Number | The App ID. |
viewId | Number | The View ID of the record list. |
viewName | String | The View Name of the record list. |
viewType | String | The type of view of the record list. *Available only if the View Type is List View or Custom View |
records | Array | An array of record objects. *Available only if the View Type is List View or Custom View |
offset | Number | The offset of the list. *Available only if the View Type is List View or Custom View |
size | Number | The number of records in the list. *Available only if the View Type is List View or Custom View |
type | String | The event type. |
Available Event Object Actions
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.
Inline Edit Event - app.record.index.edit.show
An event triggered when an inline edit of a record starts on the record list page.
Function
app.record.index.edit.show
Properties of the Event Object
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
appId | Number | The App ID. |
recordId | Number | The Record ID. |
record | Object | A record object that holds data of the record when the inline editing started. |
type | String | The event type. |
Available Event Object Actions
- Enable/Disable field edits
- By returning a
kintone.Promise
object in the event handler, event object actions can be processed after waiting for asynchronous processes in the event handler to finish.
Save Submit Event - app.record.index.edit.submit
An event triggered when the save button of the inline editing is clicked on the record list.
Function
app.record.index.edit.submit
Properties of the Event Object
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
appId | Number | The App ID. |
recordId | Number | The Record ID. |
record | Object | A record object that holds data inputted by the user. |
type | String | The event type. |
Available Event Object Actions
Limitations
Refer to the Limitations section of the Event Handling page.
Save Submit Success Event - app.record.index.edit.submit.success
An event triggered after the record has been successfully saved after clicking the save button on the record list page on the desktop.
Function
app.record.index.edit.submit.success
Properties of the Event Object
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
appId | Number | The App ID. |
recordId | Number | The Record ID. |
record | Object | A record object that holds data of the saved record. |
type | String | The event type. |
Available Event Object Actions
None
Sample showing the datetime the record was updated
|
|
Sample showing a redirect to a user specified URL after saving
If a redirect URL is specified, the event handler will redirect the page to the specified URL after returning the event object. If null, or no value is specified, the page will not redirect.
|
|
Notes
- This event is only available on the Desktop.
- This event cannot be used with an app embedded on a space.
- The event will not trigger if the record does not successfully save.
Field Change Event - app.record.index.edit.change.(fieldcode)
An event triggered when a specified field value changes during an inline editing of a record on the record list.
Function
app.record.index.edit.change.(fieldcode)
Fields that can be Specified
- Radio button
- Drop-down
- Check box
- Multi-choice
- User selection
- Date
- Time
- Date and time
- Single-line text
- Number
Properties of the Event Object
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
appId | Number | The App ID. |
record | Object | A record object including data inputted by the user at the time of the event. |
recordId | Number | The Record ID. |
changes | Object | An object including data of changed fields and rows. |
changes.field | Object | An object of the changed field. |
type | String | The event type. |
Available Event Object Actions
- Overwrite field values
- Enable/Disable field edits
- Show field errors
- Show record errors
- Get the object of the edited field
Running actions after waiting for asynchronous operations to finish
By returning a kintone.Promise
object, you can run actions after waiting for asynchronous operations to finish. Refer to the sample code for the "Save Submit Event" event on the
Record Create page.
Limitations
Refer to the Limitations section of the Event Handling page.
Delete Submit Event - app.record.index.delete.submit
An event triggered when the "Delete" button is clicked on the pop-up that appears when the delete icon of a record is clicked on the record list.
Function
app.record.index.delete.submit
Properties of the Event Object
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
appId | Number | The App ID. |
recordId | Number | The Record ID. |
record | Object | A record object that holds data of the record that will be deleted. |
type | String | The event type. |
Deleting a record after waiting for asynchronous operations to finish
By returning a kintone.Promise
object, you can delete a record after waiting for asynchronous operations to finish. Refer to the sample code for the "Save Submit Event" event on the
Record Create page.
Notes
- If false is returned, the deletion will be cancelled.
Event Limitations
The below events are only available on the Desktop, and not on the mobile:
Event Object Actions
It is possible to perform actions such as disabling a field or displaying an error on a field by changing the properties of the event object and returning it. This section explains the available actions.
Overwrite field values
If the event handler overwrites values in the fields of the record object and returns the event object, the record is saved with those values in the object.
Sample
When saving an inline edit of a record, overwrite the field "text_0" and "text_in_table_0" with a specified string. "text_in_table_0" is a field that lies within a table with field code of "table_0".
|
|
Fields that cannot be Overwritten
Even if the below fields are overwritten in the handler and returned, they will not take effect on the record itself
- Calculated
- The Field Mappings targets of the Lookup field
- Attachment
Enable/Disable field edits
If the event handler inputs true/false in the disabled
of a field of the record object and returns the event object, editing of those fields will become enabled/disabled.
Nothing will happen if this is applied to a field where you have no editing permissions.
Sample
Disable the editing of the "text_0" field when a value is selected in the drop down field "dropdown_0", during an inline edit of a record.
|
|
Fields where editing cannot be enabled/disabled
Even if the below fields are returned with the disabled
as true/false, they will not take effect on the record itself.
- Calculated
- The Field Mappings targets of the Lookup field
Show field errors
If the event handler inputs an error message in the error
of a field of the record object and returns the event object, an error message is displayed for the corresponding field.
In this case, the
Overwrite field values and the
Enable/Disable field edits are canceled.
To remove error messages from fields, input null into the error
of the field, and return the event object.
Sample
Show an error message for the fields "text_0" and "dropdown_0" when saving an inline edit for a record.
|
|
Fields that don't show error messages
Even if the below fields have error messages inputted by the handler and the object is returned, they will not take effect on the record itself.
- Record number
- Created by
- Created datetime
- Updated by
- Updated datetime
- Status
- Assignee
- Calculated
Show record errors
If the event handler inputs an error message in the error
of the event object and returns the event object, an error message is displayed for the record.
In this case, the
Overwrite field values and the
Enable/Disable field edits are canceled.
Sample
Show an error message for the record when changing a drop down field during an inline edit of a record.
|
|
Get the object of the edited field
An object containing data of an edited field can be retrieved.
Sample
Retrieve the object data of the field dropdown_0 when the value of dropdown_0 changes during an inline edit of a record in the record list.
|
|
Action Limitations
These actions are only available on the Desktop, and not on the mobile.