Skip to content

Commit

Permalink
Sort available profiles by caption (= display name) (#1823)
Browse files Browse the repository at this point in the history
<!-- Thank you for submitting a Pull Request. If you're new to
contributing to BCApps please read our pull request guideline below
* https://github.com/microsoft/BCApps/Contributing.md
-->
#### Summary <!-- Provide a general summary of your changes -->
When picking a profile in My Settings, the sorting behind the scenes
happens by profile ID and not by profile display name, causing a weird
sorting.

#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
Fixes
[AB#544052](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/544052)
  • Loading branch information
encimita authored Aug 16, 2024
1 parent 7668a17 commit 6e3533f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,19 @@ codeunit 9175 "User Settings Impl."
begin
TempAllProfile.Reset();
TempAllProfile.DeleteAll();

AllProfile.SetRange(Enabled, true);
AllProfile.SetFilter(Description, '<> %1', DescriptionFilterTxt);

if AllProfile.FindSet() then
repeat
TempAllProfile := AllProfile;
if IsNullGuid(TempAllProfile."App ID") then
TempAllProfile."App Name" := UserCreatedAppNameTxt;
TempAllProfile.Insert();
until AllProfile.Next() = 0;

TempAllProfile.SetCurrentKey(Caption, "Profile ID");
end;

procedure GetUserSettings(UserSecurityID: Guid; var UserSettingsRec: Record "User Settings")
Expand Down

0 comments on commit 6e3533f

Please sign in to comment.