[SalesForce] OpenPrimaryTab in service console opens in same tab

I have tried by giving id as null but still on click existing tabs get refreshed.

sforce.console.openPrimaryTab(null, pageName, true,'xyz',null,this.xyz, 'abz');

Best Answer

As per the salesforce console integration toolkit guide, openPrimaryTab() method takes 6 parameters, whereas you are passing seven. Please verify the same.

sforce.console.openPrimaryTab(id:String, url:URL, active:Boolean, (optional)tabLabel:String, (optional)callback:Function, (optional)name)

I tried the same example given in this link and the tab opens as a primary tab.

Also, if the tab is already open, then Salesforce console prevents opening duplicate tabs.