How to close a browser window or tab

How to close a browser window or tab

I have a page with a list of cases, the user clicks in one and opens this case in a new tab.

I want for the user to be able to click on a button to close this new tab, instead of just clickin on the "x" in the browser tab (I want to be able to save the case before exiting)

I saw this javascript...'','_self').close()

But how do I implement that in a button action?


You can either use an ajax with the RunJavascript RichWidgets action for that code, or a Navigate button with "javascript:your_code" as the target.
Sorry, but being a newbie I could not figure out how to perform either of those ideas:

1) I cannot find any "RunJavascript" RichWidget and even if I did, I would not know how/where to place it.

2) I can't type code in the "destination" box for the navigation button. All I can do is to choose a target screen or action.

Can you give me an example how to perform any one of those two solutions?

1. You need to make sure that you have a reference to it, it's in the Rich Widgets eSpace. It is an action (to be used in logic) not a widget (to be dropped on a screen).

2. Change the "Destination" to "ExternalURL" in the list, then give it the JavaScript as the URL. If your eSpace doesn't have "ExternalURL" available, go to your common widget area, right-click, choose "External Site" to create it, then right-click and add a dynamic URL parameter.