Need to call my 2nd function after fetching the details of 1st call function. whats wrong in this code…?
function to fetch Movement details
async get_movement_sheet(frm) {
if (frm.doc.customer) {
return frappe.call({
method: "logistics.utils.get_movements",
args: {
'customer': frm.doc.customer, 'fromDate': frm.doc.from_date, 'toDate': frm.doc.to_date
},
})
}
},
fill_goods_movement_sheet: async function (frm) {
if (frm.doc.customer) {
var dtl = await frm.events.get_movement_sheet(frm)
}}
#Function to fetch the item details
async get_Item_detail(frm) {
if (frm.doc.customer) {
return frappe.call({
method: "logistics.utils.get_Item",
args: {
'customer': frm.doc.customer, 'fromDate': frm.doc.from_date, 'toDate': frm.doc.to_date
},
})
}
},
fill_Item_detail: async function (frm) {
if (frm.doc.customer) {
var dtl = await frm.events.get_Item(frm)
}}
to_date: async function (frm) {
frm.trigger("fill_goods_movement_sheet");
#Need to call the fill_Item_detail function after fetching and full details of fill_goods_movement_sheet
frm.trigger("fill_Item_detail");
}