I got an error indicating the “item_ext_price” of the second row is invalid. I have no problem with the first row.
Error occurred.
An error occurred while running the JavaScript for customization of the app. Contact the app administrator. event.record[‘ItemTable’].value[1][‘item_ext_price’] is invalid.
The calculated field is non-rewritable, so its value cannot be specified.
Therefore, it is not required to be specified when adding or updating rows.
Calculated fields cannot be rewritten in JavaScript, so they are ignored even if specified.
The value of a calculated field is automatically calculated and determined by a formula, so it is impossible to explicitly specify the value of a calculated field (updating the value of a field specified in a formula will also update the calculated field on its own).
Since the conditions for specifying fields are different for adding and updating rows, I think it is the intended behavior.
The assumption is that there is always one row in the table. Therefore, the operation on the first row is not adding a row but overwriting (updating) the value of an existing row.
Since updating a row does not require specifying all fields, there was no error even if the calculated fields were not specified in the first row.
On the other hand, since the second row is an addition of a row, all fields in the table must be specified, resulting in an error.
With that in mind, I was able to test it out with an error occurring by adding the information of 「item_ext_price」 like below;