1

This is exactly the same question from here: Programmatic way to switch apps?

However this solution is outdated and not working anymore. Is there any way to switch from the current selected app to another one using Lightning or APEX?

2 Answers 2

1

Hi you can redirect to the url "/lightning/app/06m2E000000qgp1QAA". The last part is the id of the desired app.

Check the lightning/navigation that can be used both in aura/lwc

https://developer.salesforce.com/docs/component-library/documentation/en/lwc/reference_page_reference_type

https://developer.salesforce.com/docs/component-library/bundle/lightning-navigation/documentation

2
  • Thanks for the answer @Willian Matheus. But I'm struggling to get the App's ID. How to get that? Aug 26, 2021 at 13:35
  • 1
    Hi @JulioDidierMaciel try to do a query like these "Select DurableId, Label, MasterLabel, NamespacePrefix, DeveloperName from AppDefinition", the DurableId is the one that you need. Aug 26, 2021 at 14:20
1

Just found out one example to navigate to a record into another app:

URL:

/lightning/app/06m1D000000cxIzQAI/r/WorkOrder/0WO1D000000IkrbWAC/view

to get current App ID use:

String appId = [SELECT Id, AppDefinitionId FROM UserAppInfo WHERE UserId = :UserInfo.getUserId() LIMIT 1].AppDefinitionId;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.