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
Daniel RetaleatoDaniel Retaleato 

User's current running app is incorrect, and doesn't change when selecting a different App.

Hey all!

Basically, I have a component that displays different information depending on which App the user is currently in. For some reason, we have one user that returns an incorrect AppName 100% of the time.

For some reason this user always gets 'Sales' as an AppName, no matter what App they use.

The issue is only with this one user and only in production.

Anybody have any ideas why this may be happening? 


This is the code that I've been using to get the current App name:
UserAppInfo userAppInfo = [SELECT Id, AppDefinitionId FROM UserAppInfo WHERE UserId = :UserInfo.getUserId() LIMIT 1];

AppDefinition appDefinition = [SELECT DurableId, Label FROM AppDefinition Where DurableId = :userAppInfo.AppDefinitionId LIMIT 1];

return appDefinition.Label;