Skip to content

Fix Bug 630234: My Settings shows wrong company when user works in multiple browser tabs#7634

Open
darjoo wants to merge 1 commit intomainfrom
private/dajoo/630234
Open

Fix Bug 630234: My Settings shows wrong company when user works in multiple browser tabs#7634
darjoo wants to merge 1 commit intomainfrom
private/dajoo/630234

Conversation

@darjoo
Copy link
Copy Markdown
Contributor

@darjoo darjoo commented Apr 10, 2026

Summary

Fixes [Bug 630234]: My Settings shows wrong company when the user works in multiple browser tabs.

Root Cause

GetUserSettings in UserSettingsImpl.Codeunit.al reads the company from UserPersonalization.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()), prefer CompanyName() (session-local) over UserPersonalization.Company when 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 fix
  • src/System Application/Test/User Settings/src/UserSettingsTests.Codeunit.al — new test CurrentUserSettingsShowSessionCompany

Fixes AB#630234

…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.
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@darjoo darjoo marked this pull request as ready for review April 10, 2026 11:23
@darjoo darjoo requested a review from a team as a code owner April 10, 2026 11:23
@github-actions github-actions bot added this to the Version 29.0 milestone Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant