Support Article
Harness window not closing after logout from interaction portal
Summary
User has a harness which is opened as a pop up windows on click of an icon. When user logs off from interaction portal this pop up window is not getting closed.
Error Messages
Not Applicable
Steps to Reproduce
1. Configure the button as follows:

2. Add that button to a section in interaction portal so that upon the click of the button, the harness is launched in a new window.
3. Log off from the interaction portal. Notice the Harness window does not get closed.
Root Cause
An issue in the custom application code or rules:
The closing of opened windows was not handled properly.
Resolution
Refer to the following PDN article :
http://https://pdn.pega.com/support-articles/pop-ups-remain-open-after-logoff
Detailed Steps:
1. Open CPMInteractionPortalUserMenu and select logout > Actions:
2. Add Runscript Action and in the function name give CloseWindows.
3. Next, in scripts tag of UserWorkform, paste the following script:
<script>
function closeWindows() {
var curWin= null;
while (null != (curWin= application.openedWindows.pop())) {
try{
curWin.close();
}catch(e){}
}
}
pega.u.d.attachOnUnload(closeWindows);
</script>
Published May 3, 2018 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.