I want to add my newly created doc in this dropdown.
-
Go to Client Script > Add New Client Script.
-
Fill the Client Script and save it.
Name=Opportunity-Form
DocType=Opportunity
Apply To=Form
Enabled=Check.
And put the lines below in Script.
frappe.ui.form.on('Opportunity', {
refresh(frm) {
if (!frm.is_new() && frm.doc.__onload && !frm.doc.__onload.is_customer) {
frm.add_custom_button(__("Your Custom Doc"), (frm) => {
//just put your creation code here
frappe.msgprint("Your creation code goes here");
}, __("Create"));
}
},
})
- Just go to your Oppotunity form and refresh it.
Please check the reference: How open new doc with all data in object - #2 by NCP
VIdeo reference: How open new doc with all data in object - #5 by NCP