0

I have a lwc component which calls the below method after save is successful :

navigateToEventRecordPage() { this[NavigationMixin.Navigate]({ type: 'standard__recordPage', attributes: { recordId: this.eventRecordId, //objectApiName: 'Event', actionName: 'view' } }); } 

This will open the Event Record Page as a Subtab as I am on the Salesforce Console App. However, after the Event record subtab is opened, it focuses to its previous already opened subtab.

For Example : I have Subtab1, SubTab2, SubTab3, Event Subtab. Once the above method is executed, it opens Event Subtab and quickly after that goes to SubTab3.

1 Answer 1

1

You need to use SALESFORCE CONSOLE APIS (NAVIGATION ITEM API, WORKSPACE API, UTILITY BAR API) IN LIGHTNING WEB COMPONENT USING AURA AND LIGHTNING MESSAGE CHANNEL as LWC does not have that capability at the moment.

Steps to follow:-

  • Create a message channel to communicate with aura and lwc
  • Create a service aura component without ui which subscribe to lightning message fired from lwc
  • fire lightning message channel from lwc and pass the data with event
  • handle the message in aura to open a subtab and focus on it
  • Place the service aura component on the page where you have placed lwc

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.