I have this table set up where I have a running balance of what being added and taken from a cash register. I am running this script for it:
// change these names to pick a view:
let table = base.getTable('TIN');
let view = table.getView('ALL');
let result = await view.selectRecordsAsync({fields: ['Gross Added or Subtracted']});
let runningTotal = 0;
for (let record of result.records) {
// change the field names here to adapt this script to your base
runningTotal += record.getCellValue('Gross Added or Subtracted');
await table.updateRecordAsync(record, {
'Running Balance': runningTotal,
});
}
BUT, when someone counts the actual amount in the register, I want the running balance field to become equal to the actual count. How to I do this?