I'm currently using lightning:navigation via an action in a flow (this flow overrides the "New" action on a custom object list view), so users can navigate to their newly created record.
What I'm finding though is that when this navigation fires, it opens the record in a new workspace tab. Ideally, we'd like this to happen within the same tab, otherwise we just have a tab open still asking if they'd like to create a record.
The thing to note is, we're using service console. When we run the same logic outside of a service console, it will load the new record in the same tab.
We use the following method in aura to navigate to the record we want:
navigateToRecord : function(component, navigationService) {
var actionName = component.get("v.actionName");
var recordId = component.get("v.recordId");
var objectAPIName = component.get("v.objectApiName");
var pageReference = {
type: 'standard__recordPage',
attributes: {
actionName: actionName,
recordId: recordId,
objectAPIName: objectAPIName
}
};
navigationService.navigate(pageReference);
}
In the flow, we set actionName to "view", recordId to the new record we've just created, and the objectAPIName to the object name we're creating the record on.
This is showing that the tab has been created after the navigation service has fired, leaving the create new record flow still open in the previous tab:
Is there anyway we can just keep navigation within the same tab?