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?




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) {
    // custom logic

Best regards,

Hi Alex,

Thanks for the answer.

And is there the possibility to hide the button?


Best regards



Zurkowski Martin,


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:

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,

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