I have scenario to show alert dialog and on click of OK should navigate to view in CRM .
For this I have used Xrm.Navigation.openAlertDialog everything works good when I click on OK it navigates to view but on click of Esc or Close(X) button it again showing the same behavior as OK button like Opening the view which is causing infinite loop .
Presently I have used Window.open to open different page for entity View but similar thing is happening when I press Close button for Xrm.Navigation.navigateTo method also .
I have used the same code as mentioned below ..
var alertStrings = { confirmButtonLabel: "Yes", text: "This is an alert.", title: "Sample title" }; var alertOptions = { height: 120, width: 260 }; Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then( function (success) { window.open("----THIS WILL HAVE VIEW "----); }, function (error) { console.log(error.message); } );