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
Tulasiram ChippalaTulasiram Chippala 

How to open navigation of record detail page in new window

Hi I am using force:navigateTosObject.

createRecord : function (component, event, helper) {
        var navEvt = $A.get("e.force:navigateToSObject");
        var recordId =;
            "recordId": recordId,
            "slideDevName": "detail"

I want to open this navigaton in a new window. But my code is opening in the same window.
I searched in google but I didn't find any solution for this. Please help me with this.
force:navigateToSObject doesn't support opening in new tab.
Magulan Duraipandian
Khan AnasKhan Anas (Salesforce Developers) 
Hi Tulasiram,

Greetings to you!

According to Salesforce doc:
We recommend using lightning:navigation component with the standard__recordPage page type instead.

<lightning:navigation aura:id="navService"/>

//call your method/action
onClick: function(cmp, event, helper){
    var navService = cmp.find("navService");
    var pageReference = {    
       "type": "standard__recordPage", //example for opening a record page, see bottom for other supported types
       "attributes": {
       "recordId": recordId, //place your record id here that you wish to open
       "actionName": "view"

    .then($A.getCallback(function(url) {
      console.log('success: ' + url); //you can also set the url to an aura attribute if you wish,'_blank'); //this opens your page in a seperate tab here
    $A.getCallback(function(error) {
      console.log('error: ' + error);

Please refer to below link:

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas