Question

How do I disable a button or change the function behind it?

Hi community,

I am looking for 2 possibilities:

1. How can I disable a copy button in the list of opportunities?

2. How can I change the functionality behind the button?

Thanks

Like

5 comments

Just override method at OpportunitySectionV2:

copyRecord: function(editPageUId) {
    this.showInformationDialog("Not allowed");
}

 

Hello Martin,

Dmitry is right, you should simply override the desired method in replacing client module.
Please note, that if you want to save base functionality as well as add something new to it don`t forget to call callParent method. It triggers base method logic so you will be confident that base logic will work just as planned.

For example how it will look like with copyRecord method

copyRecord: function(editPageUId) {
    this.callParent(arguments);
    // custom logic
}

Best regards,
Alex

Hi Alex,

Thanks for the answer.

And is there the possibility to hide the button?

 

Best regards

Martin

 

Zurkowski Martin,

Hello,

You can simply bind it`s visible property to some boolean attribute or function.
If you want to hide not a new button but existing one, you should use "merge" operation. 
Also please follow the link to find information about diff array:

https://academy.bpmonline.com/documents/technic-sdk/7-13/diff-array

Here is an example:{

                "operation": "insert",
                "name": "12345Button",
                "values": {
                    "itemType": 5,
                    "caption": "12345",
                    "visible": {bindTo: "Show12345Button"},
                    "layout": {
                        "column": 1,
                        "row": 6,
                        "colSpan": 2,
                        "rowSpan": 1
                    }
                },
                "parentName": "LeftContainer",
                "propertyName": "items",
                "index": 9
            }

Best regards,
Alex
 

Hi Dmitry, hi Alex,

thank you both for the help.
At first I could not find out how the copy-button is called and where I find it in the opportunity-grid. At the end its called "Resources.Strings.CopyRecordGridRowButtonCaption"
It works both.
Thank you!

Log in or register to comment