2

I am trying to navigate to a Newly setup tab using a lightning component. Component is configured to be used with RecordHome and contains recordId attribute. When navigating to the component, I would like to pass-in a parameter. I tried passing using using URL while firing e.force:navigateToURL event - but it seems like that's NOT going to work. Any help is greatly appreciated.

Thanks in advance

2 Answers 2

2

There is an event called force:navigateToComponent. This might help you. But it does not have any documentation.

For example:-

navigateToRollCall : function(component, event, helper) {
var evt = $A.get("e.force:navigateToComponent");
    evt.setParams({
        componentDef: "c:AttendanceRollCall",
        componentAttributes: {
            programId: component.get("v.program.Id")
        }
    });
    evt.fire();    
}
2
  • It is not wise to use undocumented event.After some time it might not work,when salesforce removes it from public access without notifying.
    – Praveen
    Jul 12, 2016 at 15:02
  • You are always welcome Bhuvan. For time being, this is the only method. Jul 13, 2016 at 4:29
0

navigateToRollCall : function(component, event, helper) { var evt = $A.get("e.force:navigateToComponent"); evt.setParams({ componentDef: "c:AttendanceRollCall", componentAttributes: { programId: component.get("v.program.Id") } }); evt.fire();
} After calling this function in aura component.How to get the value of programId in LWC. I am stuck in similar type of scenario.

1
  • Hi Abhishek, this is not an answer to the original question. Please, if you have your own question ask it as such.
    – nbrown
    Jun 12, 2020 at 13:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .