How Do I Reload The Page Using Javascript?
-
How Do I Reload The Page Using Javascript?
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
Sorry, there were no replies found.
Log in to reply.