hello,
i want to run some code on quick entry dialog.
hello,
i want to run some code on quick entry dialog.
It is not possible
It’s possible actually, but very fragile and unreliable, because javascript =)
Create a new doctype_list.js
in your doctype’s directory along with doctype.js
and put this code there:
let old_quick_entry = frappe.ui.form.make_quick_entry;
let new_quick_entry = (doctype, after_insert, init_callback, doc) => {
old_quick_entry(doctype, after_insert, init_callback, doc);
setTimeout(() => { console.log('dialog object is accessible here ' cur_dialog);}, 500);
};
frappe.ui.form.make_quick_entry = new_quick_entry;
I think there’s a more reliable way to monkey-patch a QuickEntryForm
object to run custom triggers, but I didn’t search for it yet.
This wil only work if you try to quick entry create a new document from it’s doctype list.
For other places, you’ll need to monkey-patch respective page
object.