Is it possible to do calculations on child-table’s field customization level ??
Let say I have 3 fields in child table-> Field 1 (LinkType), Field 2(Float Type), and Field 3(Float Type).
I selected a value in field 1 and fetched a value of that Link, let say 4 . What I want is when i enter value in field 2, field 3 automatically gets value as ==>[ 4(from field 1’s link) + field’s 2 value ].
For example I selected any value in field and it fetched 4…and in field 2 i inserted 8…so on field 3…it automatically inserts 4+8 =12 …
Note all this is happening in child table… How to approach for so using field customization level. (Fetch_from is helping me to get the value of link field but how to get the value inserted in field 2 at that time and perform addition)
I have the same scenario with Sales Order Item
I have added three new fields by customize the form for sales order item and then I have added the following custom script for “sales order item” doc_type and it is not working.
frappe.ui.form.on(‘Sales Order Item’, {
board_length: function (frm, cdt, cdn) {
var row = locals[cdt][cdn];
if(row.board_length){
frappe.model.set_value(cdt, cdn, ‘curve’, flt(row.board_count * row.board_length));
}
}
});
Thank you @OmarJaber
Actully after trying a lot I find out that when you create the custom script you should create it using the doc-type of the parent document first then in the code we should depend on the child document in the code like I create the custom script on the sales order doc-type but in the code I used the child table name
frappe.ui.form.on(“Sales Order Item”, { …
Thank you again, I think the documentation on this issue is very poor I wish if it can be updated.