How to add Button link in Document Form View ? – Frappe Framework

by | Jun 2, 2021 | Frappe Framework | 0 comments

The following steps allow placing a direct link to a specific print format on the document form view using the button.

Step 1: Open the Current print preview page and click on pdf option and copy the URL


Step 2

frappe.ui.form.on("Doctype Name", "refresh", function(frm){
    frm.add_custom_button("PDF", function(){
            var myWin ='''&format=invoice%20print%20format&no_letterhead=0&letterhead=oais&settings=%7B%7D&_lang=en');

Replace your copied URL and‘’ after Invoice&name and place it in Custom script form.

Note: Replace Doctype Name with actual Doctype and to your domain

Open client script form as shown below


Final output: A direct button is added into the document form view as shown below:


By Aadhil PM



Submit a Comment

Your email address will not be published. Required fields are marked *