Skip to main content

Notifications

Dynamics 365 Community / Blogs / Adrian Begovich's Blog / Dynamics 365 Unified Interf...

Dynamics 365 Unified Interface: Show And Hide Dashboard Button Based On Currently Open Dashboard

Adrian Begovich Profile Picture Adrian Begovich 21,009 Super User 2024 Season 2

In Dynamics 365 Unified Interface, you can show and hide a dashboard button based on the currently open dashboard by creating an enable rule on your button in the ApplicationRibbon entity.

To achieve this, add the following JavaScript code to a CustomRule on your enable rule with the Ribbon Workbench.

function showDashboardButton() {
    var dashboardId = "99c027f2-c4d9-4f5d-8107-089b24cf25e4"; //replace this value with the ID of your dashboard
    var url = window.parent.location.href;
    console.log(url);

    if (url.includes(dashboardId)){
        console.log("showDashboardButton: True");
        return true;
    } else {
        console.log("showDashboardButton: False");
        return false
    }
};

pastedimage1621915685706v1.png

Comments

*This post is locked for comments