How Do I Reload The Page Using Javascript?

  • How Do I Reload The Page Using Javascript?

    Posted by Jim Corriveau on March 13, 2025 at 3:21 pm

    hello,

    I have a custom table, in the main form I have some code on the onchange event of a yes/no field, “islocked”. When the User changes the value in this field I prompt them to “confirm” using the openconfirmdialog, if they respond in the positive I call a function to do some updates and save the form data. If they respond in the negative I want to simply reload the page. I don’t want any further prompts or messages to the User, just discard everything and reloaded the form with the latest data for the current record.

    The call to the IsLockedKeep function works fine, some fields are updated and the record is saved. The location.reload(true), doesn’t reload the page, it seems to lock it up and I have to force a page refresh (ctrl-f5), then the page reloads and I’m back where I need to be.

    If location.reload is not the way to reload the page, does anyone know how to do this?

    Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
    function (success) {
    if (success.confirmed)
    IsLockedKeep(executionContext);
    else
    location.reload(true);

    });

    Thank you for your time,

    Jim

    Jim Corriveau replied 1 day, 11 hours ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

Log in to reply.

Welcome to our new site!

Here you will find a wealth of information created for people  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!