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
ChichoChicho 

How can I load a subtab only once when the page is initially loaded?

I'm using function bodyOnLoad() to load a custom visualforce page subtab in a page each time the page is loaded. What happened is that if the user is in another subtab and performs a DML operations, let's say, save a record, the entire page is loaded and consequetnly the subtab with the bodyOnLoad() function. The user will be redirected automatically from the subtab he is seeing the the custom visualforce page subtab.

I just need the custom page to be loaded once, when the user loads the page for the first time, and not each time the page is loaded.  

Is there a way or another fucntion that loads the subtab only once when you open it for the first time?

Thanks!

ChichoChicho
I'll try to exaplin it better. I'm using the agent console and one of the subtabs is a visualforce page. This VF page subtab is loaded when the user access to the agent conosle for the first time so he can see it at glance. When he opens another subtab where he saves a record, the entire agent console is loaded again after saving that record, and it takes him to the VF page subtab instead of staying in the subtab where the user was saving the record.

So whenever the agent console is loaded, not matters in what subtab the user is, it takea him to the VF page subtab. This happens because I inserted in the VF page subtab the JavaScript function bodyOnLoad() that loads the subtab and takes the user to it each time that the agent console, the entire page, is loaded.

I want to load the VF page subtab once, only when the user access to the agent console for the first time so it will see it at glance. Then, if he goes to another subtab where he saves a record, I need the user to stay in that subtab instead of being taken back to the VF page subtab.

Hope this helps. Thanks.