frappe.ui.form.on('Sales Invoice', {
refresh: function(frm) {
frm.add_custom_button(__('Issue'), function(){
new frappe.ui.form.MultiSelectDialog({
doctype: "Issue",
target: frm,
setters: {
},
get_query() {
return {
filters: { status: 'Closed' }
}
},
action(selections) {
if (selections && selections.length > 0) {
$.each(selections, function (i,items) {
customer : items;
console.log(items);
});
frm.refresh_field("items");
$(".modal").modal("hide");
}
}
});
}, __("Get Items From"));
}
});
the button and multi select dialog box is working properly
after that i couldnt merge the selected issue doctype to sales invoice
so i couldnt acheive that thing
if (selections && selections.length > 0) {
$.each(selections, function (i,items) {
customer : items;
console.log(items);
});
frm.refresh_field("items");
$(".modal").modal("hide");
}
can any one help me to ssolve this
console.log(items); =>this shows only the ID of the selected issue document