-
Notifications
You must be signed in to change notification settings - Fork 55
fix: update date field uneditable and Ignore Update Window not sent to API (#44) #140
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
base: main
Are you sure you want to change the base?
Changes from 7 commits
8f2ef5c
c593715
b53a47c
6192cd6
483a5fa
08712d3
3770b25
ab0b125
543f0be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,12 +46,21 @@ page 62025 "D4P Update Selection Dialog" | |
| Editable = DateFieldEditable; | ||
| Visible = DateFieldsVisible; | ||
| StyleExpr = RowStyleExpr; | ||
| ToolTip = 'Specifies the date for the update. Select a date between today and the latest selectable date.'; | ||
|
|
||
| trigger OnValidate() | ||
| begin | ||
| ValidateSelectedDate(); | ||
| end; | ||
| } | ||
| field("Ignore Update Window"; Rec."Ignore Update Window") | ||
| { | ||
| Caption = 'Ignore Update Window'; | ||
| Editable = DateFieldEditable; | ||
| Visible = DateFieldsVisible; | ||
| StyleExpr = RowStyleExpr; | ||
| ToolTip = 'Specifies whether to bypass the configured update window and schedule the update for any time on the selected date.'; | ||
| } | ||
| field("Rollout Status"; Rec."Rollout Status") | ||
| { | ||
| Editable = false; | ||
|
|
@@ -71,11 +80,6 @@ page 62025 "D4P Update Selection Dialog" | |
| StyleExpr = RowStyleExpr; | ||
| } | ||
| } | ||
| group(SelectionGroup) | ||
| { | ||
| Caption = 'Schedule Details'; | ||
| Visible = false; // Hidden since Selected Date is now in repeater | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -114,31 +118,28 @@ page 62025 "D4P Update Selection Dialog" | |
|
|
||
| local procedure UpdateFieldVisibility() | ||
| begin | ||
| // Show date fields if version is available | ||
| DateFieldsVisible := Rec.Available; | ||
| DateFieldEditable := Rec.Available and (Rec."Latest Selectable Date" <> 0D); | ||
|
|
||
| // Show expected fields if version is not available | ||
| DateFieldEditable := Rec.Available; | ||
| ExpectedFieldsVisible := not Rec.Available; | ||
| end; | ||
|
|
||
| local procedure SetDefaultDateTime() | ||
| begin | ||
| // Set default date to Latest Selectable Date if available | ||
| if (Rec."User Selected Date" = 0D) and DateFieldEditable then | ||
| Rec."User Selected Date" := Rec."Latest Selectable Date"; | ||
| if Rec."Latest Selectable Date" <> 0D then | ||
| Rec."User Selected Date" := Rec."Latest Selectable Date" | ||
| else | ||
| Rec."User Selected Date" := Today(); | ||
| end; | ||
|
|
||
| local procedure ValidateSelectedDate() | ||
| begin | ||
| if Rec."User Selected Date" = 0D then | ||
| exit; | ||
|
|
||
| // Validate that selected date is not in the past | ||
| if Rec."User Selected Date" < Today() then | ||
| Error(DateTooEarlyErr); | ||
|
|
||
| // Validate that selected date is not later than Latest Selectable Date | ||
| if (Rec."Latest Selectable Date" <> 0D) and (Rec."User Selected Date" > Rec."Latest Selectable Date") then | ||
| Error(DateTooLateErr, Rec."Latest Selectable Date"); | ||
| end; | ||
|
|
@@ -150,7 +151,6 @@ page 62025 "D4P Update Selection Dialog" | |
| begin | ||
| CurrentEntryNo := Rec."Entry No."; | ||
|
|
||
| // If this record is now selected, unselect all others | ||
| if Rec.Selected then begin | ||
| TempUpdate.Copy(Rec, true); | ||
| TempUpdate.Reset(); | ||
|
|
@@ -164,17 +164,17 @@ page 62025 "D4P Update Selection Dialog" | |
| end; | ||
| end; | ||
|
|
||
| procedure GetSelectedVersion(var TargetVersion: Text[100]; var SelectedDate: Date; var ExpectedMonth: Integer; var ExpectedYear: Integer) | ||
| procedure GetSelectedVersion(var TargetVersion: Text[100]; var SelectedDate: Date; var ExpectedMonth: Integer; var ExpectedYear: Integer; var IgnoreUpdateWindow: Boolean) | ||
| begin | ||
| TargetVersion := Rec."Target Version"; | ||
| SelectedDate := Rec."User Selected Date"; | ||
| ExpectedMonth := Rec."Expected Month"; | ||
| ExpectedYear := Rec."Expected Year"; | ||
| IgnoreUpdateWindow := Rec."Ignore Update Window"; | ||
| end; | ||
|
Comment on lines
+167
to
174
|
||
|
|
||
| procedure SetData(var TempSourceUpdate: Record "D4P BC Available Update" temporary) | ||
| begin | ||
| // Copy all records from source temporary table to page's temporary table | ||
| TempSourceUpdate.Reset(); | ||
| if TempSourceUpdate.FindSet() then | ||
| repeat | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "id": "f10bf877-caa5-49c6-882e-22922fca331c", | ||
| "name": "Cloud Customer Management Solution Tests", | ||
| "publisher": "Directions for partners", | ||
| "version": "0.0.2.0", | ||
| "brief": "Test app for CCMS.", | ||
| "description": "Automated tests for the Cloud Customer Management Solution.", | ||
| "privacyStatement": "", | ||
| "EULA": "", | ||
| "help": "", | ||
| "url": "", | ||
| "logo": "", | ||
| "dependencies": [ | ||
| { | ||
| "id": "e33746ef-a796-46ca-8a1a-fb3840a42c48", | ||
| "name": "Cloud Customer Management Solution", | ||
| "publisher": "Directions for partners", | ||
| "version": "0.0.2.0" | ||
| } | ||
| ], | ||
| "screenshots": [], | ||
| "platform": "1.0.0.0", | ||
| "application": "27.0.0.0", | ||
| "idRanges": [ | ||
| { | ||
| "from": 62050, | ||
| "to": 62099 | ||
| } | ||
|
jeffreybulanadi marked this conversation as resolved.
|
||
| ], | ||
|
jeffreybulanadi marked this conversation as resolved.
|
||
| "resourceExposurePolicy": { | ||
| "allowDebugging": true, | ||
| "allowDownloadingSource": true, | ||
| "includeSourceInSymbolFile": true | ||
| }, | ||
| "runtime": "16.0", | ||
| "features": [ | ||
| "NoImplicitWith", | ||
| "TranslationFile" | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,153 @@ | ||||||
| namespace D4P.CCMS.Environment.Tests; | ||||||
|
|
||||||
| using D4P.CCMS.Environment; | ||||||
|
|
||||||
| codeunit 62051 "D4P JSON Helper Tests" | ||||||
| { | ||||||
| Subtype = Test; | ||||||
|
|
||||||
| var | ||||||
| EnvironmentMgt: Codeunit "D4P BC Environment Mgt"; | ||||||
|
|
||||||
| [Test] | ||||||
| procedure TryGetJsonDate_DateOnlyString_ParsesCorrectly() | ||||||
| var | ||||||
| JsonObj: JsonObject; | ||||||
| ResultDate: Date; | ||||||
| Found: Boolean; | ||||||
| begin | ||||||
| // Arrange: date-only ISO string (root cause of Bug 1) | ||||||
| JsonObj.Add('latestSelectableDate', '2025-06-15'); | ||||||
|
|
||||||
| // Act | ||||||
| Found := EnvironmentMgt.TryGetJsonDate(JsonObj, 'latestSelectableDate', ResultDate); | ||||||
|
|
||||||
| // Assert | ||||||
| VerifyIsTrue(Found, 'TryGetJsonDate should return true for date-only string'); | ||||||
| VerifyDateEqual(ResultDate, DMY2Date(15, 6, 2025), 'Parsed date'); | ||||||
| end; | ||||||
|
|
||||||
| [Test] | ||||||
| procedure TryGetJsonDate_DateTimeString_ParsesDatePortion() | ||||||
| var | ||||||
| JsonObj: JsonObject; | ||||||
| ResultDate: Date; | ||||||
| Found: Boolean; | ||||||
| begin | ||||||
| // Arrange: datetime string — the root cause scenario (AsDateTime() returned 0DT for this) | ||||||
|
||||||
| // Arrange: datetime string — the root cause scenario (AsDateTime() returned 0DT for this) | |
| // Arrange: datetime string — validates datetime fallback parsing when extracting the date portion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new tooltip says the date must be between today and the latest selectable date, but this dialog explicitly supports cases where
Latest Selectable Dateis 0D (no upper bound) and defaults toToday(). Consider rewording the tooltip to reflect that the upper bound applies only when a latest selectable date is provided.