Unable to refresh link docfield in child table

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

You also try with add_fetch method, refer following link -

https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/custom-script-fetch-values-from-master

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 :slight_smile:

I digged into the forums and found this

But I’m unable to get how to get row.doctype, row.name, fieldname, value ?