How to force a field to be hidden

Hi, I’m trying to hide a field in the Quotation doctype called customer_name of type Data. It’s not mandatory and it’s read-only.

I checked ‘Hidden’ in the Customize Form but doesn’t work.

I wrote a script to hide but also didn’t hide.
All fields can be hidden except this

frappe.ui.form.on('Quotation', {

refresh: function (frm) {

    //hide customer_name field always on loading page
    frm.toggle_display("customer_name", true); 


Hi @Mohsin1990,

Please apply and check it.

       frm.toggle_display("customer_name", false);

Thank You!

1 Like

Well I type this impossible condition in the Depends On section and it works
but is there a better way?

Can’t use unnecessary conditions because when a new update comes then hidden button will work properly.