Fix Bug 630234: My Settings shows wrong company when user works in multiple browser tabs#7634
Open
Fix Bug 630234: My Settings shows wrong company when user works in multiple browser tabs#7634
Conversation
…in multiple browser tabs For the current user, prefer CompanyName() (session-local) over UserPersonalization.Company (shared/persisted) when CompanyName() is non-empty. This ensures My Settings shows the company from the active browser tab session, not whichever company was set last across all sessions. For other users (admin viewing another user's settings), the existing behavior is preserved.
There was a problem hiding this comment.
AL Documentation Audit
Documentation gaps were detected in the following apps:
- User-Settings-Test: 0% documentation coverage
- User-Settings: 90% documentation coverage
To generate documentation, run /al-docs init or /al-docs update using GitHub Copilot CLI or Claude Code.
This review is for awareness to help keep documentation in sync with code changes. It is okay to dismiss this request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes [Bug 630234]: My Settings shows wrong company when the user works in multiple browser tabs.
Root Cause
GetUserSettingsinUserSettingsImpl.Codeunit.alreads the company fromUserPersonalization.Company— a shared per-user record that reflects whichever company was set last across all sessions. When working in multiple browser tabs with different companies, My Settings displayed the wrong company.Fix
For the current user (
UserSecurityID = UserSecurityId()), preferCompanyName()(session-local) overUserPersonalization.Companywhen non-empty. Other-user lookups (admin scenario) retain existing behavior.Files Changed
src/System Application/App/User Settings/src/UserSettingsImpl.Codeunit.al— company source priority fixsrc/System Application/Test/User Settings/src/UserSettingsTests.Codeunit.al— new testCurrentUserSettingsShowSessionCompanyFixes AB#630234