My usecase is :
To reflect changes in the child table when it’s data field (linked to another doctype) is changed. To give an example :
Here’s the child table. It’s linked to another doctype.
When the workflow_state_var
is changed in the other doctype, the same isn’t refreshed in this child table.
How to achieve the same?
1 Like
@mr-karan , Change workflow_state_var fieldtype Data to Read Only and try again.
@priya_s Tried with Read Only also, didn’t work
add_fetch
doesn’t work on grid rows.
Can you please provide field details/screenshot of Trading Account form ?
There’s only one field which I am linking with this child table,
workflow_state_var.
I think doing frm.set_value
should solve my problem, but I’m unable to access my child table field name. Can you let me know what I need to change here for the same?
frappe.ui.form.on("DoctypeB", {
button_name: function(frm, cdt, cdn) {
frappe.call({
method: "something",
args: {
doc: frm.docname
},
callback: function(r) {
frm.set_value(frm.fields_dict.doctype_b.grid.docfields[2].fieldname, "changed");
}
})
},
});
If only I can access the field workflow_state_var
in the child table, I can use frm.set_value to edit it
I digged into the forums and found this
Hi guys!
I was able to refresh a dependent query by setting value to field using frappe.model.set_value rather than row.fieldname = value
It works like this:
frappe.model.set_value(row.doctype, row.name, fieldname, value);
Let me know if it works for you.
But I’m unable to get how to get row.doctype, row.name, fieldname, value
?