82 votes
Accepted

LWC navigation error: "this[f.NavigationMixin.Navigate] is not a function"

Apply the NavigationMixin function to your component’s base class: export default class MyLwcComponent extends NavigationMixin(LightningElement) { Hopefully this saves 3 mins of searching for those ...
Brent Bowers's user avatar
  • 3,104
9 votes

Avoid navigation to newly created record using NavigationMix

this[NavigationMixin.Navigate]({ type: 'standard__objectPage', attributes: { objectApiName: this.childObjectApiName, actionName: 'new' }, state : { count: '1',...
ddamiano's user avatar
9 votes
Accepted

LWC Navigation (NavigationMixin) Bug. CurrentPageReference Becomes undefined and won't navigate?

Wooooow, I finally figured it out. Changing { type: 'comm__namedPage', attributes: { pageName: yourPageName } } to { type: 'comm__namedPage', attributes: { ...
Luke's user avatar
  • 413
5 votes
Accepted

How to navigate to a webpage in LWC

Navigation mixin is not supported in lightning out for Visualforce or inside any other containers. The lightning/navigation service is supported only in Lightning Experience, Lightning communities, ...
Rahul Gawale's user avatar
  • 12.2k
5 votes
Accepted

LWC NavigationMixin.Navigate after creating new record not getting id

when createCertificate() is invokes, it invoked async method createRecord(recordInput) - but before it returns the result from server, the lines after that will be executed in synchronous way. You ...
salesforce-sas's user avatar
4 votes
Accepted

How to navigate to records using Datatable in Lightning Web Components

In case you want to add a hyperlink on the datatable row itself, refer the following: Define the datatable column as shown below. const columns = [ { label: 'Account Name', fieldName: 'accountIdForURL'...
Koustubh's user avatar
  • 1,143
4 votes

NavigationMixin is not working in LWC that embeded in Visualforce page

it is expected behavior. please check documentation Navigation Experience Lightning Experience, Lightning Communities, Salesforce Mobile App it will not work for Lightning Out (embedded in VF ...
Oleksandr Berehovskyi's user avatar
4 votes
Accepted

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

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/...
SFDCDJ's user avatar
  • 1,864
3 votes

Navigate to specific tab on the Account Object

You can't navigate to a particular tab on a record page in Lightning. This is not yet supported in Lightning. However, if your requirement is that user should always navigate to a particular tab ...
maniac coder's user avatar
3 votes

Is there a alternative for WorkspaceApi in LWC?

I can suggest one of the approaches that we adopted on our projects. Wrapping into Aura might be tedious, so I suggest creating an Aura Utility bar component (you can also use hidden Utility Component)...
ytiq's user avatar
  • 4,505
3 votes

Is there a alternative for WorkspaceApi in LWC?

This is possible via this https://mtr-design.com/news/salesforce-mini-how-to-open-a-subtab-in-console-from-lightning-web-component (Solution #2) I just tried it and using internalapievent as custom ...
Nagendra Singh's user avatar
3 votes

Is there a alternative for WorkspaceApi in LWC?

I think the only way to achieve this behaviour would be to wrap your component in an Aura wrapper and handle interaction with the workspace API there. The LWC component should bubble up an event to ...
voluminat0's user avatar
3 votes
Accepted

Create New related record in LWC

Pre-population is yet not supported in Lightning Web component yet for NavigationMixin functionality. I have raised an issue and an idea a long back. Yet it has not been delivered. set default value ...
sanket kumar's user avatar
  • 15.3k
3 votes

LWC: NavigationMixin.Navigate not able to refresh/reload the whole page

Using refreshApex() Since you are using a wired function, you can invoke refreshApex() to refresh the component's data when the component is loaded (i.e. in connectedCallback()), rather than pulling ...
akiradev's user avatar
  • 851
3 votes
Accepted

NavigationMixin is embedding js code in url - Error

You have to put apiname Here is the code i used for my requirement and it works properly Here is the link for your reference import { LightningElement, api} from 'lwc'; import { NavigationMixin } ...
Sahil Malhotra's user avatar
3 votes

Is there a alternative for WorkspaceApi in LWC?

There is currently a GitHub Repo which I created that allows you to do this https://github.com/Pexlify/Console-Api-For-LWCs. You simply need to deploy this to your org and place the Aura component on ...
martin conlon's user avatar
3 votes

How to navigate to records using Datatable in Lightning Web Components

I changed the javascript function to following and it worked: navigateToRecordViewPage(event) { this.record = event.detail.row; // View a custom object record. this[...
Koustubh's user avatar
  • 1,143
3 votes
Accepted

LWC - NavigationMixin not working

import { LightningElement, wire } from 'lwc'; import { NavigationMixin } from 'lightning/navigation'; export default class NavigationLinkExample extends NavigationMixin(LightningElement) { ...
olgaK's user avatar
  • 56
3 votes
Accepted

LWC - NavigationMixin Passing state

You need to get recordId from the URL. @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { this.recordId = currentPageReference.state?....
Piotr Gajek's user avatar
  • 2,625
3 votes
Accepted

LWC - NavigationMixin: Show A List Of Record Types (Closed)

In the object that you are passing, an optional parameter called state can be added where you can pass additional data like defaultFieldValues, useRecordTypeCheck etc. this[NavigationMixin.Navigate]({ ...
Chandrashekaran's user avatar
2 votes
Accepted

New tab in browser (Lightning Service Console App)

if you want new browser tab, you should not really use NavigationMixin - it will simply add the url to current url as it takes it as partial url (bug). So, instead you can use window.open directly: ...
salesforce-sas's user avatar
2 votes
Accepted

Problem with navigating to LWCs wrapped in aura component

lightning:isUrlAddressable is an Aura interface and this link states the following: The lightning:isUrlAddressable interface extends the lightning:hasPageReference interface. A component that ...
arut's user avatar
  • 5,281
2 votes
Accepted

"worksaceAPI.openTab()" equivalent for lightning web components?

Looks like official support for this is coming out soon, it was flagged for Summer 20 but I don't see support for it yet. https://help.salesforce.com/articleView?id=lex_roadmap.htm&type=5 In the ...
Derek Kania's user avatar
2 votes

getting error on click when using navigateTofileView on Contentversion record

Update the JS file with the following code: export default class customFileUpload extends NavigationMixin(LightningElement) { Since you have only imported the NavigationMixin and not extended it the ...
arut's user avatar
  • 5,281
2 votes

LWC launch URL from apex class

You're close, just get the value then use it: async navigateToWebPage() { // Navigate to a URL let url = await getURL(); this[NavigationMixin.Navigate]({ type: 'standard__webPage', ...
sfdcfox's user avatar
  • 491k
2 votes

how to navigate the lead conversion modal using navigation mixing from lwc?

If you navigate via standard convert button you will find out that standard convert process calls a standard component rather than a record page action. runtime_sales_lead__convertDesktopConsole Going ...
Nagendra Singh's user avatar
2 votes
Accepted

NavigationMixin to Community TestPage not working

Refer the documentation PageReference Types navigateToInternalPage() { // Use the basePath from the Summer '20 module to construct the URL this[NavigationMixin.Navigate]({ type: '...
Santanu Boral's user avatar
2 votes
Accepted

sessionStorage/localStorage not working with NavigationMixin

I was facing the same issue. I need to open a refreshed tab whether I open it directly or through Navigation Mixin from another tab. I tried getting values from session storage in constructor, ...
Umang Pasricha's user avatar
2 votes
Accepted

How to Navigate to particular folder of Report with Navigation button in LWC

If you observe carefully for every report folder there is record id. you can use below code to navigate particular folder. .JS import { LightningElement } from 'lwc'; import { NavigationMixin } from '...
charishma challa's user avatar
2 votes
Accepted

LWC navigate to new Opportunity only uses default record type

As per the suggestion from Zakeer in the following similar question, Lightning Web Components: navigate to the 'new' object page passing in specific record type Id?: Don't add the record type ...
Matt's user avatar
  • 21

Only top scored, non community-wiki answers of a minimum length are eligible