Only for document
cur_frm.cscript.custom_item_code = function(doc, cdt, cdn){
var child = locals[cdt][cdn];
cur_frm.call({
"method": "frappe.client.get_value",
"args": {
"doctype": "Item",
"filters": {
"name": child.item_code
}
},
"child": child,
"fieldname": "soi_size"
})
}
Solved fetching the value from the server because add_fetch dont work for fields in grid