0

I am trying to avoid hacking urls so I am using force:navigateToSObject. The only problem is what you cannot Cmd+click or Right click + "Open Link In new Tab" to navigate to the object in a new tab. This seems like something that should be already implemented. Anyone have a work around with force:navigateToSObject?

  • That's because it's not html but javascript so I don't know if it's possible to right click and open link in new tab. You can however use navigatetosobject so that it opens in a new tab, but if you want the user to be able to choose, then I don't know. – Aequitas Dec 21 '17 at 22:31
1

Best approach will be to use Salesforce Lightning Console App.

Lightning console app has tabbed structure. They even have an API to open new tabs.

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

0

You can use navigateToURL event. Maintain a base URL like https://test-salesforceBaseURL.com/ Append a relative URL by adding the ID of the record which you want to redirect

    var baseURL = 'https://test-salesforceBaseURL.com/';
    var recordId = /*recordID*/
    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
        "url": baseURL+recordId 
    });
    urlEvent.fire();
0

force:navigateToSObject is a lightning event. Lightning is a single web application. Lightning is not ready to open new tabs, because in the lightning's first load it load a lot of information.

You can use javascript to open it in a new tab, but i think that it is a wrong approach.

There is the trailhead of lightning alternatives to javascript buttons

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.