Switch into specific lightning applications from URL
Ever frustrated of asking users to view the record from the right app by asking them to navigate to it using the app launcher?
In this post, let’s see the possible solutions to get rid of this manual task of navigating to the right app before viewing the record (or any other page).
Execute the below SOQL query to fetch the DurableId
of the lightning application.
SELECT DurableId FROM AppDefinition WHERE DeveloperName = '<DeveloperName_of_the_app>'
Now copy this DurableId
and use it in the place of {durable-id}
the below URL format.
https://{lightning-base-url}/lightning/app/{durable-id}
In my case, the URL would be something like this:
https://modified-domain.lightning.force.com/lightning/app/06m5h000004Ym2FAAS
Now that we have this URL, if I want to view all the account object page inside the “Dreamhouse” application, I can simply append the relative URL path /o/Account/list
to the above URL.
https://modified-domain.lightning.force.com/lightning/app/06m5h000004Ym2FAAS/o/Account/list
The same logic applies to record pages or any other pages too (Custom Tabs, VF pages etc.)
Below are a couple of URL formats for opening record pages and custom tabs in a specific application:
https://{lightning-base-url}/lightning/app/{durable-id}/r/{object-api-name}/{record-id}/view
https://{lightning-base-url}/lightning/app/{durable-id}/n/{custom-tab-api-name}
It is important to note that the DurableId
varies in each sandbox for the same app.
To avoid using DurableId
in the URL, we can use the app’s DeveloperName
in combination with the Salesforce classic base URL, like so:
https://{org-domain-name}.my.salesforce.com/lightning/app/c__{app-developername}
In my case, to open the Dreamhouse app, the URL would be something like this:
https://modified-domain.my.salesforce.com/lightning/app/c__Dreamhouse
You might have noticed we have appended c__
prefix to the developer name of the application. That’s because Dreamhouse is a custom application. For standard applications, use the prefix standard__
before the app’s developer name.
For example, standard__Sales
.
We can apply the same logic (appending relative URL path) here as well, to open object pages or record pages in a specific application.
To open account object page inside the Dreamhouse app:
https://modified-domain.my.salesforce.com/lightning/app/c__Dreamhouse/o/account/list
That’s it! I hope this post is helpful. See ya!