It's not clear to me if you're using an Atrium tab or a browser tab, you mentioned both in your last reply. You said you think you're using Atrium... if so, when you set up the menu item (in Atrium's control panel, on the Navigation pane) then you should have properties like this:
- atriumtab.png (9.75 KiB) Viewed 674 times
The "Open as" property will determine whether you open the application as a "tab in the portal" (aka Atrium tab) or a new browser window/tab. So if you're using Atrium, then looking at these properties should tell you what sort of tab it is.
You also mention that you're running the application via a URL. Obviously (as you can see in the above screenshot) this is possible in Atrium, but it's also possible to launch a URL in a variety of other ways, such as JavaScript, or buttons/links, or even something like STRPCCMD from green-screens. In those cases, you are surely getting a browser tab because Atrium isn't being used.
So... hopefully with that info, you can determine if this is an Atrium tab or browser tab.
If this is an Atrium tab... then you are likely either launching the item as a "Rich Display", "Web Application" or "Genie Macro". For Rich Display or Web Application the tab should automaticalyl close when the program ends. If that isn't working, please contact our support department. If this is a Genie Macro, then you should have an instruction that says "Close the browser window or tab" when a particular screen is reached, and this should close things properly.
If this is a browser tab, then there are variables that can be used to control what happens when the session is closed:
http://www.profoundlogic.com/docs/displ ... n+on+Close
There's also a pui.closeSession() API as well:
http://www.profoundlogic.com/docs/displ ... sion%28%29
Also note that sometimes a browser won't let you close a tab programmatically. (I think this is a security thing.) This is a feature of the browser that we do not have control over, so when that happens, PUI will display a message asking the user to close the tab...