User has a portal which loads according to a Company account selected in the portal. CloseAllDocuments API is used to close all the tabs on switching accounts in the portal, before the content of other account loads up. This however, leaves one of the previous tabs open in Pega 7.1.6.
Steps to Reproduce
1. Create a portal with a custom harness.
2. Include a navigation rule which is used to switch between company accounts.
3. On click of the navigation call the "CloseAllDocuments" api from Pega.Desktop and pass the event object to it.
5. Run the portal and observe a dashboard being created on load of harness.
6. Open other tabs configured in the portal.
7. Switch the account using navigation rule.
8. Observe the tabs from previous account that still remains.
The "CloseAllDocuments" was taking time to complete, which caused either the page to refresh earlier and since DOM was replaced, it could never complete processing.
Perform the following local-change steps:
1.Remove the "CloseAllDocuments" from the navigation rule.
2. Add it to the onload of harness, so that it closes the tabs before creating the new one.
This also ensures that all work has been completed and dirty fields for other tabs, have also been overridden, before this API is called.