Show a break in Dynamics 365 CE alerts – JavaScript

Hi Everyone,

Today I was writing a JavaScript to some alert message to the user. To fulfill my requirement, I have to show two messages in the same box and I have written the code as below.

 var alertStrings = { confirmButtonLabel: "Ok", text: "Line 1\n Line 2", title: "Sample title" };
    var alertOptions = { height: 120, width: 260 };
    Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then(
        function (success) {
            console.log("Alert dialog closed");
        },
        function (error) {
            console.log(error.message);
        }
    );

Somehow, I felt that the message was not looking good and it would look better if give the space between message and after some search came to know that it works if we write the code as below.

var alertStrings = { confirmButtonLabel: "Ok", text: "Line 1 \n" + decodeURI("%E2%80%8A") + "\nLine 2", title: "Sample title" };
    var alertOptions = { height: 250, width: 260 };
    Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then(
        function (success) {
            console.log("Alert dialog closed");
        },
        function (error) {
            console.log(error.message);
        }
    );

Hope this helps.


Happy 365íng
Gopinath.

Clear Cache and Hard Reload – Google Chrome/Edge

Hi Everyone,

Whenever we do some changes in JavaScript, Form Changes etc. in Dynamics 365, we all know we must hard reload the browser. And sometime, even hard reload might not work for the first time and we reload the page multiple times to get the changes.

Here is the simple to clear cache and hard reload the browser and you see the changes immediately.

  • Open Dynamics 365 on Chrome/Edge Browser and open Developer Tools (Ctrl+Shift+I)
  • Put the mouse on Refresh Icon and right click. You will three options as shown below and select “Empty Cache and Hard Reload”

This option will clear the cache and reload the page.

Hope this helps.


Happy 365’ing
Gopinath.