Filter another field based on other field

Hi All,

I am trying to filter MRP field using Item Code field. Both the fields are in a child table of Stock Entry.

Here’s the client script i tried.

frappe.ui.form.on('Stock Entry', {
    onload: function (frm) {
        console.log(frm)
        frm.set_query("custom_mrp", "items", function (doc, cdt, cdn) {
          let row = locals[cdt][cdn];
          console.log(row);
          return {
            "filters": {
              "item_code": row.item_code
            },
          };
        });
  },
});

Please, help me out here. I don’t know where i am going wrong.

Could you clear your question? Like MRP field type is it data or link?

Here’s the screenshot of the field type for both the fields.

For reference, MRP is coming from a child table as well. if that is any concern point to consider.