You need to sign in to do that
Don't have an account?
simon chao
how to pass record id onto a url redirect within the lightning controller
Hi,
Within my lightning component I have a button, and when you press on it, it calls a function within the controller called userUpload. Upon clicking this button, the page will redirect you to the picture upload page.
How do i get the record id to associate itself with the page?
Currently I have,
Within my lightning component I have a button, and when you press on it, it calls a function within the controller called userUpload. Upon clicking this button, the page will redirect you to the picture upload page.
How do i get the record id to associate itself with the page?
Currently I have,
//Component: <aura:component access ="global" implements="force:hasRecordId"> <div> Click below to go to upload page </div> <lightning:button label="Upload" onclick="{!c.userUpload}" /> //Controller userUpload: function(component, event, helper) { var urlRedirect= $A.get("e.force:navigateToURL"); urlRedirect.setParams({ "url": "/upload&id=" + component.get("v.record").id }); urlRedirect.fire(); },when i console.log(component.get("v.record").id I get undefined. Anyways to fix this?
and i got blank.
Try below code it should work if not then check your recordId data.
If you find your Solution then mark this as the best answer.
Thank you!
Regards
Suraj Tripathi