Hide Buttons in Form View

Hi All
I want to hide buttons in form view
I used

frappe.ui.form.on('Sales Order', {
    refresh(frm) {
    setTimeout(() => {
        frm.remove_custom_button('Update Items');
        frm.remove_custom_button('Close', 'Status');
        frm.remove_custom_button('Work Order', 'Make');
        }, 10);
    }
})

But not working , how to solve this
Thanks.

Same here. I’m having an issue hiding the PDF button from quotation and sales order print preview page.

Increase the timeout value. Try 500, that worked for me.