Hi everyone,
I’m working on a custom Doctype in Frappe called Construction Work Order. This Doctype includes a child table named Materials Table. Each row in the child table has a field called Amount (type: Currency), and I want to calculate the sum of all the Amount
values across the rows in this table.
The calculated sum should then be displayed in a separate field in the main Doctype called Grand Total (type: Currency). Here’s what I’m trying to achieve:
- Dynamically update the Grand Total field whenever:
- A row is added, updated, or removed from the Materials Table.
- The
Amount
field in any row is modified.
- Ensure the calculation is performed on the client side (using a Client Script) for real-time updates.
I’ve tried writing some scripts, but I’m struggling to get it working correctly. Can anyone help me write a proper Client Script to achieve this functionality?
Thanks in advance for your guidance!