open dashboard on command click dataverse power apps
to open dashboard on command button click use below code.
function openDashboard()
{
var pageInput = {
pageType: "dashboard",
dashboardId:"91ed8e58-a6fa-ed11-8f6e-6045bdad1c30"
};
//optional target 1=inline (default), 2=dialog, position 1=center (default), 2=side
var navigationOptions = {
target: 2,
height: {value: 80, unit:"%"},
width: {value: 70, unit:"%"},
position: 1
};
Xrm.Navigation.navigateTo(pageInput,navigationOptions).then(
function success() {
// Run code on success
},
function error() {
// Handle errors
}
);
}