Empress Feature: Streamlining with Hiding Buttons in Form View

Introduction

Welcome to our user-friendly guide on customizing your Empress interface. In this guide, we’ll focus on a feature known as Hiding Buttons in Form View. This powerful tool allows you to adjust the visible buttons in submitted Sales Orders, providing a cleaner, simpler, and more focused interface for your users.

Why is this Feature Important?

In the world of business, the user interface isn’t just about aesthetics. A clean, well-organized interface can streamline operations, reduce user errors, and improve productivity. That’s exactly what you can achieve with the Hiding Buttons in Form View feature.

In a typical Sales Order view in Empress, you’ll see several buttons such as Update Items and Status, and multiple options under the Create button. This feature allows you to hide any unnecessary buttons, focusing the interface on the tasks at hand.

How Does it Work?

You don’t need to be a tech wizard to use this feature. Let’s break down how you can hide buttons like Update Items, Close, and Work Order using a few simple steps:

  1. Open up the Sales Order form you want to customize in Empress.

  2. In the customization option, there’s an option to input a script.

  3. This script will determine which buttons to hide. For instance, to hide the Update Items, Close, and Work Order buttons, you would use this script:

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);
    }
})
  1. Don’t worry about the technical details of the script. What you need to remember is that each frm.remove_custom_button() line in the script corresponds to a button you intend to hide. The first argument (‘Update Items’, ‘Close’, ‘Work Order’) specifies the button name, while the second argument (‘Status’, ‘Make’) specifies the parent button, if one exists.

  2. Once you’ve input the script, the specified buttons will be hidden upon refreshing the Sales Order form.

The Benefits of a Customized Interface

By strategically hiding buttons in your Empress user interface, you can:

  • Simplify the user interface, reducing confusion and potential errors.
  • Streamline your workflows by focusing on the most necessary functions.
  • Enhance user experience and productivity.

This feature is another way Empress supports your business, allowing you to customize your interface to best serve your operations. For more user-friendly guides and support, explore our resource center or reach out to our support team.