Based on lookup button will active

Hello Team,

In given screenshot actual color of offer release button is blue 

now it's in inactive state 

if status look up is reject it will active 

kindly let me know the process .hoping for a positive reply

 

regards,

uttej

 

Like 0

Like

1 comments

In order to implement enable/disable button functionality please use the "enabled" property of the button. Bind this property to the method that will check some conditions and return true or false.

Please feel free to use the example below. In the example the "Quote" button is enabled when "Category"  is "Enterprise" and disabled in other cases - https://prnt.sc/qrbpql

define("OpportunityPageV2", [], function() {

    return {

        entitySchemaName: "Opportunity",

        methods: {

            onNewQuoteClick: function() {

                this.showInformationDialog("Hello");

            },

            isEnterpriseCategory: function() {

                var result = false;

                if(this.get("Category")){

                    result = this.get("Category").value === "385e1034-b68e-4e45-b3c3-25b164235f99";//Enterprise

                }

                return result;

            }

        },

        diff: /**SCHEMA_DIFF*/[

            {

                "operation": "insert",

                "name": "NewQuoteButton",

                "parentName": "LeftContainer",

                "propertyName": "items",

                "values": {

                    "itemType": Terrasoft.ViewItemType.BUTTON,

                    "style": Terrasoft.controls.ButtonEnums.style.DEFAULT,

                    "caption": {"bindTo": "Resources.Strings.NewQuoteBtn"},

                    "click": {"bindTo": "onNewQuoteClick"},

                    "enabled": {"bindTo": "isEnterpriseCategory"},

                    "classes": {

                        "textClass": ["actions-button-margin-right"]

                    }

                }

            }

        ]/**SCHEMA_DIFF*/

    };

});

 

 

Show all comments