ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Getting Error in add buttton Custom Script


#1

I am trying to add button and by clicking on button i want to it should move in Sales order

   frappe.ui.form.on("Sales Order",{
 refresh: function(frm , cdt, cdn) {
 	 cur_frm.add_custom_button(__('Documents Review'), cur_frm.cscript.make_documents_review, __("Make"));

	cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
},make_documents_review: function() {
	console.log("hello");

}
});

when i am clicking on button i am getting some error
TypeError: t is not a function


#2

Can you post the full trace?


#3

I have resolved issue using with this code

 cur_frm.add_custom_button(__('Document Review'), function(){
	frappe.model.open_mapped_doc({
	method : "nhance.nhance.doctype.documents_review.documents_review.make_document_review",
	frm : cur_frm
	})
}, __("Make"));
}
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));