Get Add Table Row Buttons Display State

Get Add Table Row Buttons Display State - kintone.app.record.getAddTableRowButtonsDisplayState(fieldCode)

Retrieves the display state of the Add row buttons of the specified Table field.
This API retrieves the display state set by the Show or Hide Add Table Row Buttons API.

Function

Desktop

kintone.app.record.getAddTableRowButtonsDisplayState(fieldCode)

Mobile

kintone.mobile.app.record.getAddTableRowButtonsDisplayState(fieldCode)

Parameters

Parameter Type Required Description
fieldCode String Yes The field code of the Table field to retrieve the display state for.

Returns

A Promise object.
When the Promise object is fulfilled, the display state of the Add row buttons can be retrieved.

Type Description
String The display state.
  • VISIBLE: The buttons are visible.
  • HIDDEN: The buttons are hidden.

Sample Code

The following code retrieves the display state of the Add row buttons of a Table field with the field code Table.
If the buttons are visible, the code hides them.

1
2
3
4
5
6
7
kintone.events.on(['app.record.create.show', 'app.record.edit.show'], async (event) => {
  const displayState = await kintone.app.record.getAddTableRowButtonsDisplayState('Table');
  if (displayState === 'VISIBLE') {
    await kintone.app.record.showAddTableRowButtons('Table', 'HIDDEN');
  }
  return event;
});

Available Pages

Desktop and Mobile

  • Record Create
  • Record Edit

Notes

The display state of a Table field and the display state of its Add row buttons are managed separately.
If the display state of the Add row buttons is set to VISIBLE, VISIBLE is returned even if the Table field is hidden.