1
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.

Run an alert when kintone value changes

Posted at

Alert on changes when editing a record.

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

(function() {
  'use strict';

  // Data retention before editing
  let fruit_name;
   const RecordCheck = function(event) {
    fruit_name = event.record.fruit_name.value;
  }
  // Compare data on save
  const updateRecord = function(event) {
    if(fruit_name === event.record.fruit_name.value ) {
      console.log('No change in value')
    } else {
      // Execute when value changes
      alert('there was a change in values');
    }
 }

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

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

If you modify the part that says "alert('there was a change in values');" there are many applications that could benefit from it.

For example, you can run your program only when the value of a field changes.

1
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
1
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?