0
0

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 1 year has passed since last update.

kintoneのレコードの保存の際に変更があれば処理を行う。

Posted at

レコードの編集時に変更があればアラートを出す。

スクリーンショット 2023-05-04 4.54.34.png

aaaa
(function() {
  'use strict';

  // 編集前のデータ保持
  let fruit_name;
   const RecordCheck = function(event) {
    fruit_name = event.record.fruit_name.value;
  }
  // 保存時のデータと比較
  const updateRecord = function(event) {
    if(fruit_name === event.record.fruit_name.value ) {
      console.log('値に変更はありません')
    } else {
      // 差異があれば実行
      alert('値の変更がありました');
    }
 }

  const eventlist = [
    'app.record.edit.submit.success'
  ];
  kintone.events.on(eventlist, updateRecord);

  const eventlists = [
    'app.record.edit.show'
  ];
  kintone.events.on(eventlists, RecordCheck);
 
})();

アラートを出している所のコードを書き換えれば、色々応用が効くと思います。

例えば、特定のフィールドの値に変更があった時のみにプログラムを動かすことができます。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?