Hi I hope someone can help me with this:
I want to write a function in a custom script that will look for a variable in javascript which I set which is a throw away something like this:
frappe.ui.form.on("Purchase Invoice", "onload_post_render", function(frm) {
cur_frm.set_df_property("return_against","read_only",false);
cur_frm.set_query("return_against", function() {
// if (cur_frm.doc.letter_head == null) return;
return {
query: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_debit_note_query",
filters: {"pr_number": cur_frm.doc.my_var}
So I want it to only run once after “Make > Debit Note”. When I tie it to “onload_post_render” it will look for it everytime even when I try to save it later and complain that cur_frm.doc.my_var
is not found. Is there such an event which I need ?