How to get the the "make payment entry" button in user created doctype?

how to create the makepayment entry button in user created doctype(like in sales invoice doc)… i want to go to journal voucher doctype when i click the button,… plss help me!!

Regards
Arif

You can use cur_frm.add_custom_button([label], [function])

Yeah Already Use This Button function…
$.extend(cur_frm.cscript, {
onload: function() {
erpnext.add_applicable_territory();
}
},
refresh: function() {
cur_frm.add_custom_button(__(“Make Payment Entry”), function() {
frappe.route_options = {
“schedule confirmation”: cur_frm.doc.name
}
}
});
cur_frm.cscript.make_bank_voucher = function() {
return frappe.call({
method: “erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_from_schedule_confirmation”,
args: {
“schedule_confirmation”: cur_frm.doc.name
},
callback: function® {
var doclist = frappe.model.sync(r.message);
frappe.set_route(“Form”, doclist[0].doctype, doclist[0].name);
}
}
});

Yeah Already Use This Button function…
$.extend(cur_frm.cscript, {
onload: function() {
erpnext.add_applicable_territory();
}
},
refresh: function() {
cur_frm.add_custom_button(__(“Make Payment Entry”), function() {
frappe.route_options = {
“schedule confirmation”: cur_frm.doc.name
}
}
});
cur_frm.cscript.make_bank_voucher = function() {
return frappe.call({
method: “erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_from_schedule_confirmation”,
args: {
“schedule_confirmation”: cur_frm.doc.name
},
callback: function® {
var doclist = frappe.model.sync(r.message);
frappe.set_route(“Form”, doclist[0].doctype, doclist[0].name);
}
}
});