Trying to show Raw Material Cost from BOM DocType in the Production Order

Hi,

I am trying to show the Raw Material Cost from BOM DocType in the Production Order but to no avail. Both source and target fields are in Currency.

I am using the following custom script in Production Order.

frappe.ui.form.on("Production Order", {
    refresh: function(frm) {
        frm.add_fetch("bom_no", "raw_material_cost", "raw_material_cost")
    }
});

Anyone can help here? Thanks!

use add_fetch on setup not refresh.

Hi @rmehta

Thank you!

Now it does fetch value but I would have to delete the text in BOM No. field then select the BOM No. again to show the value.

Have you had any luck refreshing the fields via script to make the fetch work?

It used to work. now not working anymore and I am not pursuing as there isn’t a need at the moment.

1 Like