How to add custom button to the action dashboard?

Dear community,

 

How to add a custom button (to start the process for this activity) to the action dashboard for only one section (for ex. Case)?

 

Thanks 

Regards

Like 0

Like

7 comments

Dear Mariia,

 

You need to create a module and Extend BaseDashboardItemViewConfig cancel button. Here is the button code example:

 

define("UsrDashboardItemViewConfig", ["BaseDashboardItemViewConfig"], function() {
    Ext.define("Terrasoft.configuration.UsrDashboardItemViewConfig", {
        extend: "Terrasoft.BaseDashboardItemViewConfig",
        alternateClassName: "Terrasoft.UsrDashboardItemViewConfig",

        getActionsViewConfig: function() {
            return {
                "name": "Actions",
                "itemType": Terrasoft.ViewItemType.CONTAINER,
                "classes": {wrapClassName: ["dashboard-item-actions on-hover-visible"]},
                "items": [
                    {
                        "name": "Cancel",
                        "itemType": Terrasoft.ViewItemType.BUTTON,
                        "style": Terrasoft.controls.ButtonEnums.style.BLUE,
                        "caption": {"bindTo": "CancelButtonCaption"},
                        "click": {"bindTo": "onCancelButtonClick"},
                        "classes": {
                            "textClass": "dashboard-item-right"
                        },
                        "visible": {"bindTo": "CancelButtonVisible"}
                    },
                    {
                        "name": "Cancel2",
                        "itemType": Terrasoft.ViewItemType.BUTTON,
                        "style": Terrasoft.controls.ButtonEnums.style.BLUE,
                        "caption": "TEST",
                        "click": {"bindTo": "onCancelButtonClick"},
                        "classes": {
                            "textClass": "dashboard-item-right"
                        },
                        "visible": {"bindTo": "ExecuteButtonVisible"}
                    },
                    {
                        "name": "Execute",
                        "itemType": Terrasoft.ViewItemType.BUTTON,
                        "style": Terrasoft.controls.ButtonEnums.style.GREEN,
                        "caption": {"bindTo": "ExecuteButtonCaption"},
                        "click": {"bindTo": "onExecuteButtonClick"},
                        "classes": {
                            "textClass": "dashboard-item-right"
                        },
                        "visible": {"bindTo": "ExecuteButtonVisible"}
                    }
                ]
            };
        }
    });
});

Create replacing client module of SectionActionsDashboard

define("SectionActionsDashboard", ["UsrDashboardItemViewConfig"], function() {
    return {
        
        methods: {
            initDashboardConfig: function() {
                this.callParent(arguments);
                const dashboardConfig = this.get("DashboardConfig");
                var activityItemsConfig = {
                    "Activity": {
                        viewModelClassName: "Terrasoft.ActivityDashboardItemViewModel",
                        viewConfigClassName: "Terrasoft.BaseDashboardItemViewConfig"
                    }
                };
                if (this.$entitySchemaName === "Case") {
                    activityItemsConfig.Activity.viewConfigClassName = "Terrasoft.UsrDashboardItemViewConfig";
                }
                Ext.merge(dashboardConfig, activityItemsConfig);
                this.set("DashboardConfig", dashboardConfig);
            }
        }
    };
});

 

Regards,

Dean

Dean Parrett,

 

Thank you for your answer.
I have one more question about this:
How to add another custom "UsrDescription" column to the action dashboard ?

I tried to overload the method

 

/**
             * @inheritdoc Terrasoft.EntityDashboardItemViewModel#addQueryColumns
             * @overridden
             */
            addQueryColumns: function(esq) {
                this.callParent(arguments);
                esq.addColumn("Title", "Caption");
                esq.addColumn("Type");
                esq.addColumn("StartDate", "Date");
                esq.addColumn("Owner.Name", "Owner");
                esq.addColumn("ProcessElementId");
                esq.addColumn("UsrDescription", "Description");
            },

but it didn't work.

 

 

Thank you in advance for your answer.

 

Best regards,

Mariia

Mariia Prostiak,

 

The columns in the action dashboard are columns of activity so you need to add it on activity object first. To add it on the activity card on the action dashboard please see the community article below:

https://community.creatio.com/questions/change-task-displayed-fields

 

Best regards, 

Dennis 

Dean Parrett,

 

Can you please help me with the Model Part (ActivityDashboardItemViewModel) of the code where I have to Link the button to a business process??

Thank You in Advance,

Venkatesh

Venkatesh Sundaram,

 

Hello!

Could you please explain your issue in more detail?

 

Best regards,

Max.

Max,

 

Hello!

To make the Attached button in the Activity Element Function, i.e., For Example- If the attached button is a Cancel Button which on click should direct to another stage(Canceled) in the DCM Cycle.

Attached a Image for my request. Help me in this.

Thanks,

Venkatesh.

 

Venkatesh Sundaram,

 

If this activity is created by the DCM and the button sets the activity's status to "Canceled", you can just go into the DCM setup and set it to go to the "Canceled" stage if the activity's status is "Canceled":

 

Best regards,
Max.

Show all comments