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
Jeff Bryant 16Jeff Bryant 16 

How to get URL for Lightning Component

I have a Lightning component that deletes records as a URL button on a related list. I'm trying to find out how to get the URL for the Lightning component to call it to delete the related list records. Also, in order to delete the records would I have the call the Lightning components URL plus the recordid?
Suraj Tripathi 47Suraj Tripathi 47
Hi Jeff Bryant,
Greeting!

To get the URL for the lightning component you can use lightning:isUrlAddressable.
it will get the URL parameters in lightning components.
you can have the reference of the link below
https://www.sfdcstuff.com/2018/09/lightningisurladdressable-interface-way.html

if you find your solution mark this as the best answer.


Thank you!
Regards,
Suraj Tripathi
 
SwethaSwetha (Salesforce Developers) 
HI Jeff,
Recommend trying the approach mentioned in https://salesforce.stackexchange.com/questions/169325/delete-multiple-records-from-custom-objects-with-lightning-components

Recommended read: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/data_service_delete_record.htm

If this information helps, please mark the answer as best. Thank you