You need to sign in to do that
Don't have an account?
Navigate from a Lightning Component to Another
Hello, I am working on lightning component and stuck on scenario is there any way to switch one lightning component to another component when both are in different lightning pages.
Please Help Me.
Thanks In Advance. :)
Please Help Me.
Thanks In Advance. :)
All Answers
for refernece : https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_navigateToComponent.htm?search_text=navigate
Thanks, let me inform if it helps you
This is what you need to Navigate from one component to another
Thanks Piyush for very fast reply, I am trying the same but getting error :
[Cannot read property 'setParams' of undefined]
Here evt variable getting undifined , i am checking in console.log(evt).
YES!!
Thank you Piyush for the help its working fine now !!
How do I navigate to an account page.
I'm getting a setparams error using Raj Vakati's sample at:
https://rajvakati.com/2018/05/29/navigation-in-lightning-experience-using-pagereference/
var navService = cmp.find("navigateToAccount");
console.log('nav service: '+navService);
//console.log(cmp.get("v.SendMessage"));
var pageReference = {
type: "standard__objectPage",
attributes: {
objectApiName: "Account",
actionName: "list"
},
state: {}
};
console.log('navTo: '+ pageReference);
cmp.set("v.pageReference", pageReference);
var defaultUrl = "#";
navService.generateUrl(pageReference)
.then($A.getCallback(function(url) {
cmp.set("v.url", url ? url : defaultUrl);
}), $A.getCallback(function(error) {
console.log('there was an error: '+error);
cmp.set("v.url", defaultUrl);
}));