How to hide child table field in other company

Hi, i have set up multiple companies, in Sales Invoice child table Sales Invoice Item, i added a new field “pouring_date” but it should only visible in company A and not visible in company B. I tried putting a condition in Permissions Depend On like this: eval:doc.company==“Company A” but it doesn’t work. How to achieve this? Is this possible via client script or can be done via customize form Permissions. Thank you in advance.

Hi @EdmundDelima you can use frm.set_df_property

frappe.ui.form.on(“Sales Invoice”, {
refresh: function(frm){
if(frm.doc.company ==“Company A”){
frm.set_df_property(“your_custom_field”, “hidden”, 1)
}
})

Hi @EdmundDelima,

Please try and apply it like

eval:parent.company=="Company A"

Example:

Then reload and check it.

Thank You!

1 Like

Hello @NCP this one is working perfectly. Thank you so much.

Hi @NCP
I tested it in version 14
But it not working
image

replace the “==” with “===”.

@EdmundDelima I tried and I don’t think this is the reason

@EdmundDelima oh no it works but it doesn’t work for one field in the listview

@T941,

If parent doctype has a company field then it’s work.

Thank You!

1 Like