I want to add Get items from button to Issue doctype and i want to get items from the same docype
get_items:(frm)=>{
frappe.show_progress('Getting Items', 10, 100)
frappe.call({ method:"frappe.client.get_list",
args:{
doctype: "Items",
fields: ["name"],
filters:[
["brand","=","my_brand"],
],
limit_page_length: 100
},
callback: function(res){
frm.clear_table('my_childtable')
res.message.forEach((item)=>{
frm.add_child('my_childtable', {
childtable_field: item.name,
});
})
frm.refresh_field('my_childtable')
frappe.show_progress('Getting Items', 100, 100,'',true)
}
});
}
Check this out. Here, I’m using a button inside the form view. However, if you’re using the button, make sure the function code follows a similar structure