Close browser tab when button is clicked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 06:07 AM
Hello everyone!
I have a form button called 'Close'. My requirement is as follows: When the button is clicked, the browser tab should be closed. What scripting should be done for this in the UI Action, can anyone help me with this please?
Thanks in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2021 01:10 AM
From the newly opened tab, when I click Save & Close, the page quickly closes, but does not save the record. I have observed that mandatory fields were ignored.
However, if I use the Save & Close button directly from the original browser window tab (not launching a new tab), then mandatory fields are detected. And, when all fields have been filled in, I click Save & Close, it does save, but does not close.
Another odd behavior is the button works on a new record that hasn't been saved. Once the record has been saved, the button no longer works. Curious.
Regards,
Desmo

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2021 12:55 AM
Hi Ankur,
I tried the script and it works. Is possible to save the current record then close the window? I have this requirement.
I tried this, but it does not work. Any suggestions?
function closeWindow(){
current.update();
window.open('','_self').close();
}
Regards,
Desmo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 06:18 AM
Use:
window.top.close();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 06:28 AM
Hello Willem,
Apologies, but that line did not work. Here's what I did:
Onclick: closeWindow()
script:
function closeWindow()
{
window.top.close();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 06:23 AM
Hi,
Refer below link.
Mark it correct and helpful.
Thanks
Bhagyashri Sorte.