Hello everyone, good day. I have a question. I hav...
# suitescript
a
Hello everyone, good day. I have a question. I have a Suitelet that applies filters and populates a sublist for me, but I want to add a button on the POST form called 'Back' that returns me to the initial part of the Suitelet, the 'GET' part (refresh the suitlet). I tried using 'window.open', but it came out as 'undefined'. What is the correct way to do this? Thank you very much🙏
e
I have a Refresh button on my suitelet that reloads the page. Maybe you can play around with something like this
Copy code
//Suitelet
form.addButton({
      id: 'refresh_page',
      label: 'Refresh',
      functionName: 'refresh'
    });

//Client Script
function refresh() {
  console.log('refresh');
  var baseUrl = new URL(window.location.href);
  var refreshUrl = baseUrl.toString();
  window.onbeforeunload = null;
  window.location.replace(refreshUrl);
}
thanks 1