Fetch child table - Custom Script


Company Name OBERPRO
Job Type Customization
Country Mexico
Date June 2, 2019
Status Withdrawn

Details

Hi, My knowledge on coding is so basic and I don't have a programmer in house. I've being struggling to find how to solve this: I need to pull data from 'items' table at Sales Invoice to 'carta_ubicacion_referencia' a custom table at Delivery Note. The following code works with other doctypes, where tables have the same name, but not on this particular case. frappe.ui.form.on("Delivery Note", "sales_invoice", function(frm,cdt,cdn) { frappe.model.with_doc("Sales Invoice", frm.doc.sales_invoice, function() { var tabletransfer = frappe.model.get_doc("Sales Invoice", frm.doc.sales_invoice); $.each(tabletransfer.items || [], function(i, d) { frm.add_child("carta_ubicacion_referencia"); cur_frm.doc.carta_ubicacion_referencia[i].item_code = d.item_code; cur_frm.doc.carta_ubicacion_referencia[i].warehouse = d.warehouse; }) }) }); Actually my instance have versions: ERPNext: v11.1.35 (master) Frappe Framework: v11.1.32 (master) Regards.

Contact

You must register and login to view contact details


Post a New Job