Help Get Value from Sales Order to Work Order

I would like to get what customer selected in Sales Order to appear in Work Order.
I already customize my Work Order Doctype and create custom field named Customer Name type:data
and test all i searched scipts but nothings working.

tested script:

frappe.ui.form.on('Sales Order', {
refresh: function(frm)
{
	frm.add_fetch("sales_order","customer_name","customer_name");
}
 });

tested script:

frappe.ui.form.on("Sales Order", "customer_name", function(frm, cdt, cdn) {
   var d = locals[cdt][cdn];
   frappe.model.set_value(cdt, cdn, "customer_name");
});

tested script:

frm.add_fetch("sales_order","customer_name","customer_name");

but nothing happened when i make work order from sales order

1 Like

@Dragavs were you able to solve this?

I already solve this when i upgrade to version 12, i just use Fetch From in customize form

Would you mind please explain how you have done it, as I have tried many things and still cannot.

I only just add field in my Work Order and put this in Fetch From.
image

i am not sure why this is not working for me!

Is this customize from Work Order? can you check your Sales Order field if it is linked to Sales Order?

Yes, its customize from work order

and sales order already linked:

okay, so now it works.

same like the above pictures, but for it to update you need to reselect the Sales Order number for it to show.

This topic was automatically closed after 33 hours. New replies are no longer allowed.