Geeks,
JavaScript on new interface UCI is throwing error when we use standard alert() method on BPF field OnChange event.
alert(“message”); //Old code that is failing
sometimes it takes you to infinite loop after you click Ok to come out of context.
Easy fix as suggested by Microsoft to start use below code on UCI and .then() for call back functions is optional
Xrm.Navigation.openAlertDialog({ confirmButtonLabel: "Ok", text: "message" }).then(
function success(result) {
console.log("Alert dialog closed");
},
function (error) {
console.log(error.message);
}
);
// new code working
Version: D365 CE online v 9.1 wave 2
Original Post https://mscrmsama.wordpress.com/2019/11/01/d365-ce-uci-javascript-alert-throwing-error-replace-with-xrm-navigation-openalertdialog/