Hello Muhaymin,
The record update process “PUT” is executed many times by a for statement.
There is a bulk update process “PUT” to update records.
If you want to update information in the event object,
it may be better to perform a bulk update after generating a request to update multiple records.
Also, after performing the record update process, you will need to describe the screen redrawing process.
If you describe the redrawing process in the record list screen, please be careful because
the process may fall into an infinite loop.
I’m a little unclear as to how much information you wish to have, but,
If you want to update the records displayed on the record list screen,
you can use the following process below.
(function() {
"use strict";
kintone.events.on('app.record.index.show', function (event) {
var records = event.records;
var wRecord = {};
var wRecords = [];
for (var i = 0; i < records.length; i++) {
var record = records[i];
wRecord = {
"id":records[i].$id.value,
"record":{
"age":{
"value":"19"
}
}
};
wRecords.push(wRecord);
}
var wParm = {
"app":kintone.app.getId(),
"records":wRecords
};
kintone.api(
'/k/v1/records',
'PUT',
wParm,
function(res){
console.log(res);
},
function(err){
console.log(err);
}
);
});
}());
It is not ideal to use the for statement to register records one by one.
It is desirable and better to do a bulk update.
Also, please be careful when redrawing the record list screen, to avoid an infinite loop
you will need a flag to determine that you have updated.
Hopefully, this helps.