Skip to content

Commit

Permalink
[CES] Show survey on My Settings page (microsoft#750)
Browse files Browse the repository at this point in the history
#### Summary <!-- Provide a general summary of your changes -->
Show survey on My Settings page, also show survey before write
transaction since it does RunModal

#### 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#507133](https://dynamicssmb2.visualstudio.com/Dynamics%20SMB/_workitems/edit/507133/)
  • Loading branch information
onbuyuka authored Mar 15, 2024
1 parent 9386838 commit 855e1ba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,12 @@ page 9204 "User Settings"

trigger OnQueryClosePage(CloseAction: Action): Boolean
begin
if CloseAction = Action::OK then
if CloseAction = Action::OK then begin
if OldUserSettings."Legacy Action Bar" <> Rec."Legacy Action Bar" then
if Rec."Legacy Action Bar" then
UserSettingsImpl.ShowLegacyActionBarSurvey();
UserSettingsImpl.UpdateUserSettings(OldUserSettings, Rec);
end;
end;

var
Expand All @@ -164,4 +168,4 @@ page 9204 "User Settings"
UserSettingsImpl: Codeunit "User Settings Impl.";
LastLoginInfo: Text;
LastLoginInfoVisible: Boolean;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ codeunit 9175 "User Settings Impl."

GetAppSettings(NewUserSettings."User Security ID", ApplicationUserSettings);
ApplicationUserSettings."Teaching Tips" := NewUserSettings."Teaching Tips";
ApplicationUserSettings."Legacy Action Bar" := NewUserSettings."Legacy Action Bar";
ApplicationUserSettings.Modify();
end;

Expand Down Expand Up @@ -398,15 +399,20 @@ codeunit 9175 "User Settings Impl."
procedure EnableLegacyActionBar(UserSecurityID: Guid)
var
ApplicationUserSettings: Record "Application User Settings";
CustomerExperienceSurvey: Codeunit "Customer Experience Survey";
FormsProId: Text;
FormsProEligibilityId: Text;
IsEligible: Boolean;
begin
ShowLegacyActionBarSurvey();
GetAppSettings(UserSecurityID, ApplicationUserSettings);
ApplicationUserSettings."Legacy Action Bar" := true;
ApplicationUserSettings.Modify();
end;

procedure ShowLegacyActionBarSurvey()
var
CustomerExperienceSurvey: Codeunit "Customer Experience Survey";
FormsProId: Text;
FormsProEligibilityId: Text;
IsEligible: Boolean;
begin
if CustomerExperienceSurvey.RegisterEventAndGetEligibility('modernactionbar_event', 'modernactionbar', FormsProId, FormsProEligibilityId, IsEligible) then
if IsEligible then
CustomerExperienceSurvey.RenderSurvey('modernactionbar', FormsProId, FormsProEligibilityId);
Expand Down

0 comments on commit 855e1ba

Please sign in to comment.