Fetch data from Sales order Item to Production order

Hello dears

I`m trying to fetch data from Sales order Item Table to production order useing the below

frappe.ui.form.on(“Production Order”, “onload”, function(frm) {
frappe.db.get_value(“Sales Order Item”, { name: cur_frm.doc.sales_order_item},
“following_notes1”, function(data){
cur_frm.set_value(“following_notes1”, data.notes); });

But im facing that error while im accessing as Administrator and have the full permissions on two doctypes

Any idea about that error ??

Note : above Custom script working well while fetching data from Sales Order Doctype but casing permissions error while trying to fetch data from child table

Any Help !

try this,

frappe.ui.form.on("Production Order", "onload", function(frm) {
			method: "frappe.client.get_value",
			args: {
				doctype: "Sales Order Item",
				fieldname: "following_notes1",
				filters: { 'name': cur_frm.doc.sales_order_item},
				parent: "Sales Order"
			callback: function(r) {		
				cur_frm.set_value(“following_notes1”, r.message.following_notes1);
1 Like

Thank you so much man . It finally works !!

1 Like