4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

kintoneカスタマイズ基礎-部品集-

Last updated at Posted at 2019-12-25

kintoneカスタマイズ用部品集

kintoneでjsを書いてカスタマイズする時用の、書き方備忘録です。

1. 詳細画面でレコードの値を取得する


kintone.events.on('app.record.detail.show', function(event) {
  var hensu = event["record"]["フィールドコード"]["value"];
}

2. 編集画面でレコードの値を取得する

var events = ['app.record.create.show','app.record.edit.show'];
kintone.events.on(events, function(event) {
  var record = event.record;
  var hensu = record['フィールドコード']['value'];

3. フィールドの入力可・不可の制御


kintone.events.on(['app.record.edit.show', 'app.record.create.show'],function(event){
  var record = event.record;
  //編集を可能にする
  record['氏名']['disabled'] = false;
  //編集を不可にする
  record['氏名']['disabled'] = true;

4. グループの開閉

kintone.events.on(events, function(event) {
  var record = event.record;
  //グループを開く
  kintone.app.record.setGroupFieldOpen('グループのフィールドコード', true);
  //グループを閉じる
  kintone.app.record.setGroupFieldOpen('グループのフィールドコード', false);

5.ルックアップ自動取得(レコード追加時)

kintone.events.on('app.record.create.show', function(event) {
  var record = event.record;
  //ルックアップ自動取得
  record['ルックアップのフィールドコード']['lookup'] = true;
4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?