Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.x] Skip upgrade when correct Code is used in Guided Experience Item #992

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ codeunit 1991 "Guided Experience Impl."
end;
end;

local procedure GetCode(Type: Enum "Guided Experience Type"; ObjectType: Enum "Guided Experience Object Type"; ObjectID: Integer; Link: Text[250]; VideoUrl: Text[250]; SpotlightTourType: Enum "Spotlight Tour Type"): Code[300]
internal procedure GetCode(Type: Enum "Guided Experience Type"; ObjectType: Enum "Guided Experience Object Type"; ObjectID: Integer; Link: Text[250]; VideoUrl: Text[250]; SpotlightTourType: Enum "Spotlight Tour Type"): Code[300]
var
Url: Text[250];
begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ codeunit 1999 "Guided Experience Upgrade"
GuidedExperienceImpl: Codeunit "Guided Experience Impl.";
NewCode: Code[300];
begin
// Skip upgrade if the current Code is already considering SpotlightTourType, we have seen this happening during migration.
if GuidedExperienceItem.FindFirst() then
if GuidedExperienceItem.Code = GuidedExperienceImpl.GetCode(GuidedExperienceItem."Guided Experience Type", GuidedExperienceItem."Object Type to Run", GuidedExperienceItem."Object ID to Run", GuidedExperienceItem.Link, GuidedExperienceItem."Video Url", GuidedExperienceItem."Spotlight Tour Type") then
exit;

GuidedExperienceItem.Reset();

GuidedExperienceItem.SetRange(SystemCreatedAt, 0DT, CurrentDateTime());
if GuidedExperienceItem.FindSet() then
repeat
Expand Down
Loading