Add Update Cost Button for Custom Doctype

I want add Custom Button to my custom doctype to update price field (child table field) like BOM

image

Please check the bom code:

explore it and develop it your own way according to the scenario.

1 Like

instead of this long code i tried this way,
i remove all price from doctype and when i save doctype refetch the value

frappe.ui.form.on('CE Price List', {
    refresh: function(frm) {
        frm.add_custom_button(__('Clear Price Field'), function() {
            clearPriceField(frm);
        });
    }
});

function clearPriceField(frm) {
    var childTableRows = frm.doc.item_list || [];

    for (var i = 0; i < childTableRows.length; i++) {
        var childRow = childTableRows[i];
        childRow.price = ''; 
    }
    frm.refresh_fields('item_list');
    frm.dirty(true);
}

Thank You for reply @NCP