function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC Forum 9SFDC Forum 9 

How to get current url in lightning

How to write below peice of code in lightning, please assist.


 System.currentPageReference().getParameters().put('id',theNewContId)


My requirement is, will be on contact detaled page, i have data table which displays list of orders of that contact.

When i click on any row's checkbox in that datatable, it has to get  that particular order details and refrsh the current page and open page ,for this new page, will have to contruct url in lightning same as above.
                   
Best Answer chosen by SFDC Forum 9
{tushar-sharma}{tushar-sharma}
you need to navigation component.
component.find("navigation")
    .navigate({
        "type" : "standard__recordPage",
        "attributes": {
            "recordId"      : theNewContId,
            "actionName"    :  "view"   //clone, edit, view
        }
    }, true);
If this answer helps you, please mark it as accepted.

Regards,
Tushar Sharma
https://newstechnologystuff.com/