Question

Action on edit page

Can someone provide me with the code to add a action to the actions on a edit page. I am trying to add this action the same way as the section page, but it does not seem to work.

 

Below is my code.

This is the contact page.

            isCustomActionEnabled: function() {
                var id = this.get("Id");
                return true;
            },
            createInternalSupportTicket: function() {
             window.console.log("createInternalSupportTicket");
            },
            getSectionActions: function() {
              window.console.log("getSectionActions");
                var actionMenuItems = this.callParent(arguments);
                actionMenuItems.addItem(this.getButtonMenuItem({
                    Type: "Terrasoft.MenuSeparator",
                    Caption: ""
                }));
                actionMenuItems.addItem(this.getButtonMenuItem({
                    "Caption": {bindTo: "Resources.Strings.RegisterInternalSupportTicket"},
                    "Click": {bindTo: "createInternalSupportTicket"},
                    "Enabled": {bindTo: "isCustomActionEnabled"}
                }));
                return actionMenuItems;
            },   

Thanks in advance.

Like 0

Like

1 comments

Hello Tyler,

 

getSectionActions is the BaseSectionV2 method and it has no implementation in the BasePageV2. You need to override the getActions method that is a part of BasePageV2. So in your case the code should be:

isCustomActionEnabled: function() {
                var id = this.get("Id");
                return true;
            },
            createInternalSupportTicket: function() {
             window.console.log("createInternalSupportTicket");
            },
            getActions: function() {
              window.console.log("getSectionActions");
                var actionMenuItems = this.callParent(arguments);
                actionMenuItems.addItem(this.getButtonMenuItem({
                    Type: "Terrasoft.MenuSeparator",
                    Caption: ""
                }));
                actionMenuItems.addItem(this.getButtonMenuItem({
                    "Caption": {bindTo: "Resources.Strings.RegisterInternalSupportTicket"},
                    "Click": {bindTo: "createInternalSupportTicket"},
                    "Enabled": {bindTo: "isCustomActionEnabled"}
                }));
                return actionMenuItems;
            },   

Best regards,

Oscar

Show all comments