i want to add many buttons and each one call specific print format
how could i did this?
Hii @manal_erpnext
button onclick event you can perform this for opening specific print format :
let print_format = "Payment Receipt";
let url = frappe.urllib.get_full_url(
`/api/method/frappe.utils.print_format.download_pdf?doctype=${encodeURIComponent(
frm.doc.doctype
)}&name=${encodeURIComponent(
frm.doc.name
)}&format=${encodeURIComponent(
print_format
)}&no_letterhead=0`
);
window.open(url, "_blank");
I hope this works for you.
1 Like
for redirecting specific print format i am not sure how to achive but please check once i hope this works for you