+ Start a Discussion
Surender reddy SalukutiSurender reddy Salukuti 

how can i pass record id in url ?

Hi i have a requirement how can i pass record id value in url plese help me on this i have tried with below code but not working 

var recordid= component.get("v.recordId");
        var urlEvent = $A.get("e.force:navigateToURL");
            "url": "https://farmersagent--intdev.lightning.force.com/lightning/r/Account/0011b00000xc84cAAA/related/Quotes__r/view?0.source=alohaHeader"
if i hardcode id it working fine 
in place of 0011b00000xc84cAAA this id replace with recordid it's not working can any one help me on this 

Thanks ,

Surender Reddy 

Suraj Tripathi 47Suraj Tripathi 47
Hi Surender,

Try below code it should work if not then check your recordId data.
var urlEvent = $A.get("e.force:navigateToURL");
            "url": "https://farmersagent--intdev.lightning.force.com/lightning/r/Account/"+component.get("v.recordId")+"/related/Quotes__r/view?0.source=alohaHeader"

If you find your Solution then mark this as the best answer. 

Thank you!
Suraj Tripathi

AbhinavAbhinav (Salesforce Developers) 
As sugeested in below sample code for address:
navigate : function(component, event, helper) { //Find the text value of the component with aura:id set to "address" var address = component.find("address").get("v.value"); var urlEvent = $A.get("e.force:navigateToURL"); urlEvent.setParams({ "url": 'https://www.google.com/maps/place/' + address }); urlEvent.fire(); }

I think you can concat that for record Id as well.