Skip to content

Commit

Permalink
[AI Test Tool] Update lines when changing input dataset (microsoft#1933)
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 updating the input dataset of the suite, we should update the lines
to clearly reflect what dataset will be used for each line.

#### 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#547352](https://dynamicssmb2.visualstudio.com/Dynamics%20SMB/_workitems/edit/543079/)
  • Loading branch information
stkillen authored Sep 26, 2024
1 parent 07bccab commit 177669e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ table 149032 "AIT Test Method Line"
exit(AITTestSuite."Input Dataset");
end;

trigger OnInsert()
var
AITTestSuite: Record "AIT Test Suite";
begin
if AITTestSuite.Get(Rec."Test Suite Code") then
Rec."Input Dataset" := AITTestSuite."Input Dataset";
end;

trigger OnDelete()
var
ALTestSuite: Record "AL Test Suite";
Expand Down
13 changes: 13 additions & 0 deletions src/Tools/AI Test Toolkit/src/TestSuite/AITTestSuite.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ table 149030 "AIT Test Suite"
TableRelation = "Test Input Group".Code;
ValidateTableRelation = true;
ToolTip = 'Specifies the dataset to be used by the test suite.';

trigger OnValidate()
var
AITTestMethodLine: Record "AIT Test Method Line";
begin
if GuiAllowed() then
if not Dialog.Confirm(InputDatasetChangedQst) then
exit;

AITTestMethodLine.SetRange("Test Suite Code", Rec.Code);
AITTestMethodLine.ModifyAll("Input Dataset", Rec."Input Dataset", true);
end;
}
field(8; "Ended at"; DateTime)
{
Expand Down Expand Up @@ -240,4 +252,5 @@ table 149030 "AIT Test Suite"

var
BaseVersionMustBeLessThanVersionErr: Label 'Base Version must be less than or equal to Version';
InputDatasetChangedQst: Label 'You have modified the input dataset.\\Do you want to update the lines?';
}

0 comments on commit 177669e

Please sign in to comment.