URL Accessibility in LWC is a feature that makes it accessible using URL. The Lightning web component can be navigated directly via a URL, allowing deeper integration with the Salesforce Lightning Experience’s routing system. This feature was introduced in Summer 24, before it we were using the lightning aura component isUrlAddressable
interface.
Refer to our post Call Lightning Component using Formula Link for learning URL accessibility in the lightning aura component.
Use case of URL Accessibility in LWC
1. Accessible using Formula Hyperlink
We can directly navigate to specific components based on the formula link prepared using the condition of the current record. No container component is required to show the component.
2. External Access
We can provide external users with a URL to access specific components within the Lightning application. We can pass parameters to display relevant data on the viewed page.
3. Testing and Debugging
It provides direct URL access to components to make testing and debugging simpler. QA teams can quickly navigate to specific components and states using URLs during testing cycles.
4. Integration with Other Systems
We can use this feature to integrate Salesforce components with other systems that rely on URL navigation. We can redirect to a specific component within Salesforce to display related data or execute specific actions after we receive a response from an external system. External systems can also redirect directly to specific components.
Implementation of URL Accessibility in LWC
Use Case
Open a component from the hyperlink formula field to display a summary/individual data for a record based on the passed parameter.
Solution
Create a URL addressable lightning web component that will handle the passed parameter. We will need a parameter name view to show related data.
Formula Hyperlink Field
Create a hyperlink formula field of Text type in the account record. This field will display as a link on the record page. LWC (Lightning Web Component) will be shown when clicked on this link.
Component name and parameter name are case-sensitive. So put the name accordingly.
Test Page for URL Accessibility in LWC
References
Navigate to a URL-Addressable Lightning Web Component
Related Posts
Streamlining Authentication: Custom Login Flow in Salesforce
Call Lightning Component using Formula Link
Top 5 Salesforce Apex Features of Summer’24
How to Dynamically Evaluate Formulas in Salesforce Apex?
Implementing Apex Cursors for Optimal Resource Management in Salesforce
Need Help?
Need some kind of help in implementing this feature, connect on my LinkedIn profile Dhanik Lal Sahni.