0

enter image description here

If you looked into the above image. Here Pick Your Branch is a visualforce tab. In this VF page one button is there called Save.

On Click of Save, I need to close the VF page and Open home page.

I am able to open the Home page using

window.location='/home/home.jsp?isdtp=vw';

But if you see Pick Your Branch tab name and icon will remain same

enter image description here

I tried to set the title and icon using below code but since it is redirecting to another page it is not able to set the title and icon.

sforce.console.setTabTitle('Home');
sforce.console.setTabIcon('/img/icon/t4v35/standard/home_60.png', null, checkResult);

I am looking for any standard way to open home tab in console and close my current VF page tab.

0

So after some research I found that, We can open tab using setSelectedNavigationTab()

Documentation: https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_setselectednavigatortab.htm

Using below code I am able to open home page. 'nav-tab-1' is the home tab Id.

 sforce.console.setSelectedNavigationTab(callback,'nav-tab-1');

 var callback = function (result) {
            if (result.success) {
              console.log('Successful');
            } else {
              console.log('something is wrong!');
            }
        } 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.