I have a component that displays different input fields depending on which App the user is currently using.
For some reason, we have one System Admin that gets 'Sales' returned as an AppName, regardless of which App they are currently using.
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;