Skip to main content
13 votes

Is it possible to navigate to a Visualforce page from an LWC with parameters and community compatible

Yes its possible to open a vf page in Lwc. I m sharing the lwc must haves import { NavigationMixin } from 'lightning/navigation'; export default class Re_myClass extends NavigationMixin (...
Sunidhi's user avatar
  • 141
13 votes
Accepted

Is it possible to navigate to a Visualforce page from an LWC with parameters and community compatible

OK, so we didn't find a direct way to do it. Failed approach Initially we thought that the following approach should work for normal and community usage. In essence we implemented a component with ...
Phil W's user avatar
  • 37k
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

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,904
5 votes
Accepted

Lightning Web Component: Navigation on Button-Click

You should either use href of anchor tag to go to url or you should use Navigate method of mixin. Option 1: Using Navigate: (recommended) HTML: <div> <lightning-button label="Acc Home" ...
salesforce-sas's user avatar
4 votes
Accepted

LWC in Visualforce Lightning Out context using Lightning Navitagion

As far as I have searched documentation, there is no standard way of knowing in which container a component is being loaded. Solution: We can create a @api property called container through which we ...
salesforce-sas's user avatar
4 votes

How to avoid hardcoding of page name in lightning:navigation?

You can use an auraAttrubute to store the page you want to use. <aura:attribute name="pageName" type="String"/> How can you choose the page to use? Sorry, but i don't have enough reputation ...
Christian Croce's user avatar
4 votes
Accepted

What difference does the __c make in currentPageReference in code?

Previously, you could just use keyword, but in order to tighten security, it was changed so that you would need to include the "namespace" as part of the state. For unmanaged code, this is ...
sfdcfox's user avatar
  • 497k
3 votes
Accepted

How to navigate to the profile page in Communities using lightning:navigation?

Since you need to pass along a recordId, you need to set page type as standard__recordPage like this: handleGoToProfile: function(cmp, event, helper) { const pageReference = { ...
Shamina's user avatar
  • 4,295
3 votes
Accepted

Navigation from lwc inside a visual force page

I have found a solution passing function as attribute in lwc. <apex:page standardController="Account" sidebar="false"> <apex:includeLightning /> <div id=...
Manjot Singh's user avatar
  • 3,526
3 votes

How to add a link to my lightning-tree-grid rows?

To use onrowaction, you need to define the actions correctly. I created two playgrounds to demonstrate this. .html <template> <lightning-tree-grid data={data} columns={...
sfdcfox's user avatar
  • 497k
3 votes
Accepted

NavigationMixin.Navigate - Navigate and Set Case Values

unfortunately setting default values on navigateMixin in LWC is not yet supported: LWC counterpart to Aura's force:createRecord event What you can do instead is create an Aurawrapper component ...
Jefferson Fernandez's user avatar
3 votes

Unable to navigate to community page using <lightning:navigation

Looks like as a part of summer19 release (https://releasenotes.docs.salesforce.com/en-us/summer19/release-notes/rn_networks_navigationenhancements.htm), for communities the navigation can be achieved ...
Mohith Shrivastava's user avatar
3 votes
Accepted

LWC: lightning-navigation is not a function

I added a comment but it looks like you are missing the export, and extending the MixIn. So your code needs to look more like this: import { LightningElement } from 'lwc'; import { NavigationMixin } ...
Kevin Hill's user avatar
2 votes

On save navigate to record detail page

You can utilize lightning:navigation and the standard__recordPage page reference type here. Once the record has been saved and you have the record id (you will need to have this for the component to ...
Jayant Das's user avatar
  • 30.6k
2 votes

How to do dynamic routing from one component to another component through anchor tags??Which we usually do in javascript

The "#" in an HTTP(S) URL introduces the "fragment ID", something that can be interpreted by the browser as referencing a specific element in the HTML by ID or that can be used by ...
Phil W's user avatar
  • 37k
2 votes
Accepted

NavigationMixin.Navigate does not navigate

This will not work as you are using lightning out, I would suggest you to use window.open('/'+ObjectId); JS method to do the navigation. If you are trying to navigate to account record page then ...
gs650x's user avatar
  • 2,678
2 votes

Navigating from an Aura component to a Visualforce page gives navigation error 'browser blocks cross-domain cookies'

This is due to browser settings. Salesforce are aware of this issue, caused by the fact that Lightning and Classic (including Visualforce pages) URLs actually relate to different domains and that in ...
Phil W's user avatar
  • 37k
2 votes
Accepted

Redirect to a Report from an LWC with dynamic parameters not working

The Navigation documentation mentions NavigationMixin adds two APIs to your component's class: [NavigationMixin.Navigate](pageReference, [replace]) - A component calls this API to navigate to another ...
Kris Goncalves's user avatar
2 votes
Accepted

TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions

Add this. in front of contentDocumentId - contentDocumentId is not local :-)
Felix van Hove's user avatar
1 vote

LWC Navigation/Routing from one page to another

This answer uses LWR and Client-Side Routing. Create a wildcard route in your lwr.config.json like so: ... routes: [ { "id": "appRoot", "path": "/*", ...
JonShipman's user avatar
1 vote

LWC Navigation/Routing from one page to another

You can use lightning-navigation for this use case. It has different page types you can use, based on your use case, to navigate. https://developer.salesforce.com/docs/component-library/documentation/...
Nagendra Singh's user avatar
1 vote
Accepted

NavigationMixin to standard__objectPage passing recordType value

You can try like this:- showNewOpportunityForm(recordTypeId) { this[NavigationMixin.Navigate]({ type: 'standard__objectPage', attributes: { objectApiName: 'Opportunity', ...
sanket kumar's user avatar
  • 15.4k
1 vote
Accepted

Evaluation of approach to navigate between 3 LWC pages

Both of the approaches will work. I personally will prefer approach 1 where Parent Component passes states down to other components. For the second approach you will need aura components wrapping lwc ...
Mohith Shrivastava's user avatar
1 vote
Accepted

lightning:navigation defaultFieldValues not working in lightning communiy

As per the documentation: This component is not supported in Lightning Out, Lightning communities, or the Salesforce mobile app. (my emphasis)
Phil W's user avatar
  • 37k
1 vote

lightning/navigation in communities lwc

I think you need to use type: 'comm__namedPage' if you're in a community
MarcusMaximi's user avatar
1 vote
Accepted

Please help me with the Navigation component

I was finally able to figure out navigation component doesn't work in developer console , but I was able to use on standard page.
user56430's user avatar
1 vote

Why @wire(CurrentPageReference) pageRef; is causing following JS error

It looks like you should still be able to get pagereference and just ignore the error. This code still works: (taken from https://github.com/trailheadapps/lwc-recipes/tree/master/force-app/main/...
Ben Nguyen's user avatar
1 vote
Accepted

Open child component from parent on the same page

you should use lightning:overlayLibrary to show component as modal popup. first add overlay component in to your component then update your fire like below code snippet for your use case. cmp <...
sdandamud1's user avatar
  • 2,715
1 vote

Query String is not added while navigating in lightning

Query parameters are only included in URLs as long as they have a namespace prefix of some kind (e.g. "c__"). See the documentation for further details.
Phil W's user avatar
  • 37k

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