I am trying to fetch doc link from a custom document that I build and has an option for attachment
frappe.ui.form.on(‘Upload Purchases’, “refresh”, function(frm){
frm.add_custom_button(__(“Book Purchase”), function() {
let lcv = frappe.model.get_new_doc('Purchase Invoice');
lcv.date_of_uploading = frm.doc.posting_date;
lcv.attach_invoice = frm.doc.invoice_attachment;
frappe.set_route("Form", lcv.doctype, lcv.name);
});
});
Unable to do it using above code