can we use window.location.reload(url of a record)...
# suitescript
v
can we use window.location.reload(url of a record)?
n
yep. in a client script
to reload you just have to do location.reload() To navigate to a new url you would use
Copy code
window.location.replace(url);
Copy code
window.onbeforeunload = null;
You can use this to prevent the pop up asking if its ok to leave the page
v
ok thank you
is it ok to use the url instead of true in the reload function?
n
Im not sure that location.reload takes any parameters. But i could be wrong there. It just uses the current URL with parameters to reload the page. If you were wanting to change anything about the URL thats when you would use location.replace() https://developer.mozilla.org/en-US/docs/Web/API/Location/reload