Enhance Opportunity Form in ERPNext: Hide Create Supplier Quotation, Close & Request for Quotation, Add Set as Lost Button

by | Feb 26, 2024 | ERPNEXT, Frappe Framework | 0 comments

Optimize your ERPNext Opportunity form by customizing buttons for smoother workflow. Hide clutter by removing the ‘Create Supplier Quotation’, ‘Close’ and ‘Request for Quotation’ buttons while introducing a streamlined action with the addition of the ‘Set as Lost’ button. Enhance user experience and focus on key actions with this tailored form modification. Explore Frappe framework capabilities for efficient ERP customization.

Add Following code as client script:
Home > Customization > Client Script

frappe.ui.form.on('Opportunity', {
    refresh(frm) {
        frm.add_custom_button("Set as Lost", () => {
            frm.set_value("status", "Lost");
        });

        setTimeout(() => {
            frm.remove_custom_button('Supplier Quotation', 'Create');
            frm.remove_custom_button('Request For Quotation', 'Create');
            frm.remove_custom_button('Close');
        }, 10);
    }
});

Client Script Docs: https://frappeframework.com/docs/user/en/desk/scripting/client-script

By Aadhil PM

0 Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *