Staff Payment Receipt Expenses is a child form (field name - expenses)
reference_invoice,reference_payment are both link fields in the Staff Payment Receipt Expenses form reference_invoice is link field referring to an invoice table reference_payment is a link field referring to invoice items, a child table of invoice table
what i tried to do is when i select an invoice (reference_invoice field), i need reference_payment to show entries having parent reference_invoice.(simply i dont want to show an invoice item from another invoice)
I believe code is correct but doesnt work when i select reference_invoice.
But its filtered when i select the row after i insert it.
Why its not working at the same time ? What can i do to make it work properly?
hey, how can i refresh the field after setting the get_query ? I am changing the get_query based on a Checkbox.
New fields gets the latest get_query function, but how to update the old ones ?
I tried this :
cur_frm.fields_dict["items"].grid.get_field("item_code").get_query = customGetQuery;
$.each(cur_frm.fields_dict["items"].grid.grid_rows, function(i, row) {
var field = frappe.utils.filter_dict(row.docfields, {fieldname: "item_code"})[0];
field.get_query = customGetQuery;
row.refresh_field("item_code");
});
Can you please tell what I am doing wrong ?
Thanks
well I am
My requirement is to show only those items having balance stock in current warehouse in the dropdown list of the link field, based on a check. So sometimes, many items will be added and later on the checkbox will be checked. I want to update the old field’s link queries…
By the way, when is form_render event fired ? Where can i get some docs to read on client side programming ?
I got what are you trying to do, but by experience, in the way that are you trying to do, frappe don’t support. You only can refresh a field that is being diplayed!
Form_render is fired when the user display a table form!
To it work properly you need disable editable grid.