LoginSignup
0
0

More than 1 year has passed since last update.

一覧画面でテーブルの集計値をjsワンライナー計算

Posted at

さすがに、すべてをワンライナーで書くと長いので計算部分のみ、

total.js
(() => {
    'use strict';
    kintone.events.on('app.record.index.show', (event) => {
        console.log(`(合計)  ${event.records.reduce((total, record) => total += record['テーブル'].value.reduce((value, row) => value += Number(row.value['数値'].value), 0), 0)}`);
    });
})();

注意:
一覧画面で表示中のレコードのみの計算になるので、
最高で100件まで。

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