1

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;

1 Answer 1

1

For what i understand, salesforce updates the user app info from time to time not when the user uses the actual app.

This means that using the app definition to make components have different behaviors is not really reliable for users that have access to multiple apps.

I suggest you switch your logic to use record types instead, make you apex code receive the record type and change your behavior based on that.

PS: I'm a junior so it's possible I'm incorrect, this is information that i deducted after i had the exact same issue, hope it helps in any way

1
  • 1
    hi João, can you please let us know where you found this information? I am working on some functionality requiring this object and it would be great to get more details Commented Apr 16 at 10:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .