Set_column_disp doesnt display fields in table

if (frm.doc.company === “value”) {

        cur_frm.fields_dict.items.grid.set_column_disp("custom_man_days", true);
        msgprint("hi");

this is my code and and i am using this in Sales Invoice
the msgprint is getting displayed but the field is not showing in the list view

@519_Hamza_Habeeb Try this.

if (frm.doc.company === "value") {
    frm.fields_dict.items.grid.set_column_disp("custom_man_days", true);
    frappe.msgprint("hi");
}

i tried that as well before but that doesnt work

@519_Hamza_Habeeb
1.Check whether the control is going into that block or not, by adding some debugging statements.
2. use different method.

frm.fields_dict.items.grid.toggle_display("custom_man_days", true);

3.Ensure that the field name is correct.


i am getting the msg and the fieldname is correct

@519_Hamza_Habeeb Use depends on condition in the custom field.

eval: doc.company=='value'

will that work for grid view?

this doesnt work for grid view