when click on Label Print button then nothing will happen not show any error massage and not open printing page
frappe.ui.form.on('Delivery Note', {
refresh: function(frm) {
frm.add_custom_button(__('Lable Print'), function() {
// Replace 'your_custom_format_name' with the actual name of your custom print format
frappe.call({
method: 'frappe.utils.print_format.download_pdf',
args: {
doctype: 'Delivery Note',
name: (frm.doc.name),
format: 'label_dn',
},
callback: function(r) {
if (r.message) {
var w = window.open(r.message);
if (!w) {
frappe.msgprint(__('Please enable pop-ups for this site.'));
}
}
}
});
});
}
});
My concern is i want do this by method and argument . Can do little changes in my code format it will work. what should i change in my argument to send encoded data .