[SalesForce] NavigationMixin.Navigate to Record Detail Page is not working for Console Navigation App

I've created a custom form in LWC where I added 2 buttons & this LWC is on Record page on as a Quick Action button(LWC is called from Lightning Flow), Save and Cancel. Both are custom button and navigates back to the Record Detail Page. For this below is the code that I have added to navigate to the Record Detail Page:

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

I have tested this on the app whose navigation style is Standard. navigation works there as expected but when I launch Application(Service) whose navigation style is Console, then above code does not work.

Can someone please tell me what changes are required?

Best Answer

As per below Salesforce Documentation, When we navigate to Record View Page, We can keep objectApiName as an optional parameter.

https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_navigate_page_types

So after removing objectApiName in my code, its working somehow. Not sure if its best practice for Console Navigation. but its working.

this[NavigationMixin.Navigate]({
                    type: 'standard__recordPage',
                    attributes: {
                        recordId: this.recordId,
                        //objectApiName: 'Case', // objectApiName is optional
                        actionName: 'view'
                    }
                });
Related Topic