From 4993531c7f257186bb78fa728dc3c131e2dce1b5 Mon Sep 17 00:00:00 2001 From: Andreas Moth <10121161+AndreasMoth@users.noreply.github.com> Date: Thu, 10 Oct 2024 17:26:14 +0200 Subject: [PATCH] Fetching user settings should return the company specified in the user personalization if specified (#2143) Currently we are specifying that all users are in the current company, however we should only fall back to this if the user personalization does not specify otherwise. This fixes an issue on users list where all users are shown to be in the current company. Fixes [AB#537109](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/537109) --- .../App/User Settings/src/UserSettingsImpl.Codeunit.al | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System Application/App/User Settings/src/UserSettingsImpl.Codeunit.al b/src/System Application/App/User Settings/src/UserSettingsImpl.Codeunit.al index 74c4d40e0f..40c928ff35 100644 --- a/src/System Application/App/User Settings/src/UserSettingsImpl.Codeunit.al +++ b/src/System Application/App/User Settings/src/UserSettingsImpl.Codeunit.al @@ -130,7 +130,7 @@ codeunit 9175 "User Settings Impl." UserSettingsRec."Locale ID" := UserPersonalization."Locale ID"; UserSettingsRec."Time Zone" := UserPersonalization."Time Zone"; - if CompanyName() <> '' then + if (UserPersonalization.Company = '') and (CompanyName() <> '') then UserSettingsRec.Company := CopyStr(CompanyName(), 1, 30) else UserSettingsRec.Company := UserPersonalization.Company;