Does anyone know how to close suitelet tab after s...
# suitescript
p
Does anyone know how to close suitelet tab after submit? I tried window.close() and it seems not working. Not sure which part is wrong
e
I’ve used this: `_context_.response.write(``
<h1>Adjustment(s) Created</h1>
<p id="only"> This window will close in 5 seconds. </p>
<script>
var timeleft = 4;
var downloadTimer = setInterval(function(){
if(timeleft <= 0){
clearInterval(downloadTimer);
document.getElementById("only").innerHTML = "Finished";
} else {
document.getElementById("only").innerHTML = "This window will close in " + timeleft + " seconds.";
}
timeleft -= 1;
}, 1000);
setTimeout(() => {
window.close();
}, 5000);
</script>
``)`
you can obviously change the H1 and whether or not you want the count down
p
Thanks. I will give it a try.