From 6b0fea16b64806bdfcc1e5f391ce8fd0a5d82fab Mon Sep 17 00:00:00 2001 From: Pranav Nachanekar Date: Mon, 23 Sep 2019 11:26:18 +0530 Subject: [PATCH] Added buttons to linked docs --- erpnext/crm/doctype/appointment/appointment.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/erpnext/crm/doctype/appointment/appointment.js b/erpnext/crm/doctype/appointment/appointment.js index 4e41047fa1..975abfcd93 100644 --- a/erpnext/crm/doctype/appointment/appointment.js +++ b/erpnext/crm/doctype/appointment/appointment.js @@ -2,7 +2,16 @@ // For license information, please see license.txt frappe.ui.form.on('Appointment', { - // refresh: function(frm) { - - // } + refresh: function(frm) { + if(frm.doc.lead){ + frm.add_custom_button(__(frm.doc.lead),()=>{ + frappe.set_route("Form","Lead",frm.doc.lead) + }) + } + if(frm.doc.calendar_event){ + frm.add_custom_button(__(frm.doc.calendar_event),()=>{ + frappe.set_route("Form","Event",frm.doc.calendar_event) + }) + } + } });