0

I am using the openPrimaryTab() method to open a custom page as tab.

<script src="/support/console/43.0/integration.js" />
<script type="text/javascript">
    function OpenPrimaryTab() {
        //Open a new primary tab with the appropriate case in it
        sforce.console.openPrimaryTab(null, 'http://www.salesforce.com', false, 'salesforce', openSuccess, 'salesforceTab');
    }

    var openSuccess = function openSuccess(result) {
        //Report whether opening the new tab was successful
        if (result.success == true) {
            alert('Primary tab successfully opened');
        } else {
            alert('Primary tab cannot be opened');
        }
    };
</script>

Its working in Console Navigation in Salesforce lightning view. But its not working in Standard Navigation in Salesforce lightning view.

1 Answer 1

1

Lightning already offers lightning:workspaceAPI, which provides access to console controls.

Here you can see an example:

({
   openTab : function(component, event, helper) {
       var workspaceAPI = component.find("workspace");
       workspaceAPI.openTab({
           url: '#/sObject/001R0000003HgssIAC/view',
           focus: true
       });
   },
})

See the reference here.

1
  • Thanks for update. Without any components its possible to open new tab in Salesforce lightning standard navigation.
    – Viji
    Commented May 14, 2018 at 13:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .