Skip to content

Instantly share code, notes, and snippets.

@tyoshikawa1106
Created March 15, 2015 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyoshikawa1106/5d5f7842b84003c90088 to your computer and use it in GitHub Desktop.
Save tyoshikawa1106/5d5f7842b84003c90088 to your computer and use it in GitHub Desktop.
e.force:navigateToSObject sample code
createRecord : function (component, event, helper) {
var navEvt = $A.get("e.force:navigateToSObject");
navEvt.setParams({
"recordId": "00QB0000000ybNX",
"slideDevName": "related"
});
navEvt.fire();
}
@ArunaVasahan
Copy link

ArunaVasahan commented Jul 6, 2017

I have tried the above code and I found that the value for attribute"slideDevName" is not working. No matter what we give there[details,related] it's just navigating/refreshing the page.

@tangpengAtIBM
Copy link

hi if you implement it in the lightning experience or mobile 1

@svk1993d
Copy link

I am doing in lightning experience, but it is still not working. Do we need to add any particular interface in component?

@Sumati96
Copy link

I also tried and it did not worked for me. Please suggest if anyone found a way to work with navigateToSobject related tab.
Alternative is the navigateToRelatedList component to go to the "Attachment" related List.
handleClick : function (component, event, helper) {
var relatedListEvent = $A.get("e.force:navigateToRelatedList");
relatedListEvent.setParams({
"relatedListId": "CombinedAttachments",
"parentRecordId": event.target.id
});
relatedListEvent.fire();
}

@kristinemaimai
Copy link

"You can set a specific slide in the Salesforce app, but not in Lightning Experience."

Please refer to this site: https://developer.salesforce.com/docs/component-library/bundle/force:navigateToSObject/documentation

I also wanted to use "related" but I just found out this today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment