function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tuan ND 5Tuan ND 5 

My sub tab is not getting closed and the Primary tab not refreshes after sub tab is closed When refresh page or re-login enviroment

My requirement is this, I have a Case Edit VF page which opens from a Edit custom button located on a Case Detail page on Lightning Experience .
The Case Edit VF Page has a Save CommandButton which performs update to the Case fields on the Case Edit page.
The Case Edit VF Page is opened as a Sub tab to a Case Primary tab on the console.

First on the Case detail page I click on the Edit button to move to the Case Edit VF page. This page opened as a Sub tab to a Case Primary tab on the console.Next, I refresh page or re-login enviroment, the sub tab is reopened. After that I click Save CommandButton to save and close the Sub tab which contains the Case Edit VF Page.
I find a weird issue here,
Desire: My sub tab is getting closed first and the Primary tab refreshes after sub tab is closed.
Reality: My sub tab is not getting closed and the Primary tab not refreshes after sub tab is closed

The cause of the initial investigation that I have investigated is: After refresh page or re-login enviroment, press the Save button CommandButton to close the subtab and refresh the main tab with the functions getEnclosingPrimaryTabId() and getEnclosingTabId(), the results of these functions does not return the correct tab Id. Currently the value of tab ID returned when calling console.log('tab ID: ' + result.id) is undefined