From 211da125fe214bb64479b522b4e6832f62739960 Mon Sep 17 00:00:00 2001 From: attilatoury Date: Tue, 3 Feb 2026 14:53:40 +0100 Subject: [PATCH 1/2] added Expression Formula field to test card page + removed unused card part --- .../Template/Test/QltyTestCard.Page.al | 19 + .../Test/QltyTestExprCardPart.Page.al | 562 ------------------ .../Permissions/QltyGeneral.PermissionSet.al | 1 - 3 files changed, 19 insertions(+), 563 deletions(-) delete mode 100644 src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestExprCardPart.Page.al diff --git a/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestCard.Page.al b/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestCard.Page.al index e9419ad068..750e1be12d 100644 --- a/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestCard.Page.al +++ b/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestCard.Page.al @@ -41,6 +41,21 @@ page 20479 "Qlty. Test Card" AboutTitle = 'Description'; AboutText = 'The friendly description for the test. You can enter a maximum of 100 characters, both numbers and letters.'; } + field("Expression Formula"; Rec."Expression Formula") + { + AboutTitle = 'Expression Formula'; + AboutText = 'Used with expression test value types, this contains the formula for the expression content.'; + MultiLine = true; + Editable = IsExpressionFormulaEditable; + + trigger OnAssistEdit() + begin + if IsExpressionFormulaEditable then + Rec.AssistEditExpressionFormula() + else + Message(StrSubstNo(NotEditableLbl, Rec.FieldCaption(Rec."Expression Formula"), Rec.FieldCaption(Rec."Test Value Type"))); + end; + } field("Test Value Type"; Rec."Test Value Type") { AboutTitle = 'Test Value Type'; @@ -569,6 +584,8 @@ page 20479 "Qlty. Test Card" EditableResult: Boolean; IsAllowableValuesEditable: Boolean; IsLookupField: Boolean; + IsExpressionFormulaEditable: Boolean; + NotEditableLbl: Label 'The %1 field is not editable for the selected %2.', Comment = '%1 = Expression Formula, %2 = Test Value Type'; trigger OnOpenPage() begin @@ -615,6 +632,8 @@ page 20479 "Qlty. Test Card" Visible10 := MatrixVisibleState[10]; EditableResult := (Rec.Code <> '') and (CurrPage.Editable) and (Visible1) and (MatrixArrayCaptionSet[1] <> ''); + + IsExpressionFormulaEditable := (Rec."Test Value Type" = Rec."Test Value Type"::"Value Type Text Expression"); end; local procedure UpdateMatrixDataCondition(Matrix: Integer) diff --git a/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestExprCardPart.Page.al b/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestExprCardPart.Page.al deleted file mode 100644 index 83e953499d..0000000000 --- a/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestExprCardPart.Page.al +++ /dev/null @@ -1,562 +0,0 @@ -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.QualityManagement.Configuration.Template.Test; - -using Microsoft.QualityManagement.Configuration.Result; -using Microsoft.QualityManagement.Utilities; - -/// -/// Used to help with expression configuration. -/// -page 20467 "Qlty. Test Expr. Card Part" -{ - Caption = 'Quality Test Expression Card Part'; - PageType = CardPart; - SourceTable = "Qlty. Test"; - LinksAllowed = false; - InsertAllowed = false; - DeleteAllowed = false; - ApplicationArea = QualityManagement; - - layout - { - area(Content) - { - field("Code"; Rec.Code) - { - Editable = false; - AboutTitle = 'Code'; - AboutText = 'The short code to identify the test. You can enter a maximum of 20 characters, both numbers and letters.'; - } - field(Description; Rec.Description) - { - Visible = false; - AboutTitle = 'Description'; - AboutText = 'The friendly description for the Test. You can enter a maximum of 100 characters, both numbers and letters.'; - } - field("Expression Formula"; Rec."Expression Formula") - { - AboutTitle = 'Expression Formula'; - AboutText = 'Used with expression test value types, this contains the formula for the expression content.'; - MultiLine = true; - - trigger OnAssistEdit() - begin - Rec.AssistEditExpressionFormula(); - end; - } - field("Default Value"; Rec."Default Value") - { - AboutTitle = 'Default Value'; - AboutText = 'A default value to set on the test.'; - - trigger OnAssistEdit() - begin - Rec.AssistEditDefaultValue(); - end; - } - field("Allowable Values"; Rec."Allowable Values") - { - AboutTitle = 'Allowable Values'; - AboutText = 'What the staff inspector can enter and the range of information they can put in. For example if you want a measurement such as a percentage that collects between 0 and 100 you would enter 0..100. This is not the pass or acceptable condition, these are just the technically possible values that the inspector can enter. You would then enter a passing condition in your result conditions. If you had a result of Pass being 80 to 100, you would then configure 80..100 for that result.'; - - trigger OnAssistEdit() - begin - Rec.AssistEditAllowableValues(); - end; - } - field(ChooseUOM; QltyTest."Unit of Measure Code") - { - ShowCaption = true; - } - group(GroupSeparator_a) - { - Caption = ' '; - } - label(lblInfo) - { - Caption = ' '; - } - group(SettingsForPassConditions) - { - Caption = 'Field Conditions'; - - label(lblInfo2) - { - ApplicationArea = All; - Caption = 'In this section you will define conditions for results, such as pass results.'; - } - group(SettingsForNothingVisible) - { - ShowCaption = true; - Visible = not Visible1; - Caption = ' '; - - label(lblgrpNothingVisibleInfo) - { - ApplicationArea = All; - Caption = 'There are no results available to display.'; - } - } - group(SettingsForVisible1) - { - ShowCaption = false; - Visible = Visible1; - Caption = ' '; - - label(Visible1lblInfo) - { - ApplicationArea = All; - Caption = ' '; - } - group(SettingsForVisible1Advanced) - { - ShowCaption = false; - Caption = ' '; - - field(Field1; MatrixArrayConditionCellData[1]) - { - ColumnSpan = 2; - CaptionClass = '3,' + MatrixArrayCaptionSet[1] + ' Cond.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 1'; - Editable = Visible1; - - trigger OnValidate() - begin - HandleTestValidateAdvancedSyntax(1); - end; - } - } - field(Field1_Desc; MatrixArrayConditionDescriptionCellData[1]) - { - ColumnSpan = 2; - CaptionClass = '3,' + MatrixArrayCaptionSet[1] + ' Desc.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 1'; - Editable = Visible1; - - trigger OnValidate() - begin - HandleTestValidateConditionDescription(1); - end; - } - } - group(SettingsForVisible2) - { - ShowCaption = false; - Visible = Visible2; - - group(SettingsForVisible2Advanced) - { - ShowCaption = false; - - field(Field2; MatrixArrayConditionCellData[2]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[2] + ' Cond.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 2'; - Editable = Visible2; - - trigger OnValidate() - begin - HandleTestValidateAdvancedSyntax(2); - end; - } - } - field(Field2_Desc; MatrixArrayConditionDescriptionCellData[2]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[2] + ' Desc.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 2'; - Editable = Visible2; - - trigger OnValidate() - begin - HandleTestValidateConditionDescription(2); - end; - } - } - group(SettingsForVisible3) - { - ShowCaption = false; - Visible = Visible3; - - group(SettingsForVisible3Advanced) - { - ShowCaption = false; - field(Field3; MatrixArrayConditionCellData[3]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[3] + ' Cond.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 1'; - Editable = Visible3; - - trigger OnValidate() - begin - HandleTestValidateAdvancedSyntax(3); - end; - } - } - field(Field3_Desc; MatrixArrayConditionDescriptionCellData[3]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[3] + ' Desc.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 3'; - Editable = Visible3; - - trigger OnValidate() - begin - HandleTestValidateConditionDescription(3); - end; - } - } - group(SettingsForVisible4) - { - ShowCaption = false; - Visible = Visible4; - - field(Field4_Desc; MatrixArrayConditionDescriptionCellData[4]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[4] + ' Desc.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 3'; - Editable = Visible4; - - trigger OnValidate() - begin - HandleTestValidateConditionDescription(4); - end; - } - group(SettingsForVisible4Advanced) - { - ShowCaption = false; - - field(Field4; MatrixArrayConditionCellData[4]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[4] + ' Cond.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 1'; - Editable = Visible4; - - trigger OnValidate() - begin - HandleTestValidateAdvancedSyntax(4); - end; - } - } - } - group(SettingsForVisible5) - { - ShowCaption = false; - Visible = Visible5; - - field(Field5_Desc; MatrixArrayConditionDescriptionCellData[5]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[5] + ' Desc.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 3'; - Editable = Visible5; - - trigger OnValidate() - begin - HandleTestValidateConditionDescription(5); - end; - } - group(SettingsForVisible5Advanced) - { - ShowCaption = false; - - field(Field5; MatrixArrayConditionCellData[5]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[5] + ' Cond.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 1'; - Editable = Visible5; - - trigger OnValidate() - begin - HandleTestValidateAdvancedSyntax(5); - end; - } - } - } - group(SettingsForVisible6) - { - ShowCaption = false; - Visible = Visible6; - - field(Field6_Desc; MatrixArrayConditionDescriptionCellData[6]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[6] + ' Desc.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 3'; - Editable = Visible6; - - trigger OnValidate() - begin - HandleTestValidateConditionDescription(6); - end; - } - group(SettingsForVisible6Advanced) - { - ShowCaption = false; - - field(Field6; MatrixArrayConditionCellData[6]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[6] + ' Cond.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 1'; - Editable = Visible6; - - trigger OnValidate() - begin - HandleTestValidateAdvancedSyntax(6); - end; - } - } - } - group(SettingsForVisible7) - { - ShowCaption = false; - Visible = Visible7; - - field(Field7_Desc; MatrixArrayConditionDescriptionCellData[7]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[7] + ' Desc.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 3'; - Editable = Visible7; - - trigger OnValidate() - begin - HandleTestValidateConditionDescription(7); - end; - } - group(SettingsForVisible7Advanced) - { - ShowCaption = false; - - field(Field7; MatrixArrayConditionCellData[7]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[7] + ' Cond.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 1'; - Editable = Visible7; - - trigger OnValidate() - begin - HandleTestValidateAdvancedSyntax(7); - end; - } - } - } - group(SettingsForVisible8) - { - ShowCaption = false; - Visible = Visible8; - - field(Field8_Desc; MatrixArrayConditionDescriptionCellData[8]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[8] + ' Desc.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 3'; - Editable = Visible8; - - trigger OnValidate() - begin - HandleTestValidateConditionDescription(8); - end; - } - group(SettingsForVisible8Advanced) - { - ShowCaption = false; - - field(Field8; MatrixArrayConditionCellData[8]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[8] + ' Cond.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 1'; - Editable = Visible8; - - trigger OnValidate() - begin - HandleTestValidateAdvancedSyntax(8); - end; - } - } - } - group(SettingsForVisible9) - { - ShowCaption = false; - Visible = Visible9; - - field(Field9_Desc; MatrixArrayConditionDescriptionCellData[9]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[9] + ' Desc.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 3'; - Editable = Visible9; - - trigger OnValidate() - begin - HandleTestValidateConditionDescription(9); - end; - } - group(SettingsForVisible9Advanced) - { - ShowCaption = false; - - field(Field9; MatrixArrayConditionCellData[9]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[9] + ' Cond.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 1'; - Editable = Visible9; - - trigger OnValidate() - begin - HandleTestValidateAdvancedSyntax(9); - end; - } - } - } - group(SettingsForVisible10) - { - ShowCaption = false; - Visible = Visible10; - field(Field10_Desc; MatrixArrayConditionDescriptionCellData[10]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[10] + ' Desc.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 3'; - Editable = Visible10; - - trigger OnValidate() - begin - HandleTestValidateConditionDescription(10); - end; - } - group(SettingsForVisible10Advanced) - { - ShowCaption = false; - field(Field10; MatrixArrayConditionCellData[10]) - { - CaptionClass = '3,' + MatrixArrayCaptionSet[10] + ' Cond.'; - ToolTip = 'Specifies a test condition for a promoted result. This is dynamic based on the promoted results, this is result condition 1'; - Editable = Visible10; - - trigger OnValidate() - begin - HandleTestValidateAdvancedSyntax(10); - end; - } - } - } - } - } - } - - var - QltyTest: Record "Qlty. Test"; - QltyResultConditionMgmt: Codeunit "Qlty. Result Condition Mgmt."; - QltyMiscHelpers: Codeunit "Qlty. Misc Helpers"; - MatrixSourceRecordId: array[10] of RecordId; - Visible1: Boolean; - Visible2: Boolean; - Visible3: Boolean; - Visible4: Boolean; - Visible5: Boolean; - Visible6: Boolean; - Visible7: Boolean; - Visible8: Boolean; - Visible9: Boolean; - Visible10: Boolean; - MatrixMinValue: array[10] of Decimal; - MatrixMaxValue: array[10] of Decimal; - MatrixArrayConditionCellData: array[10] of Text; - MatrixArrayConditionDescriptionCellData: array[10] of Text; - MatrixArrayCaptionSet: array[10] of Text; - MatrixVisibleState: array[10] of Boolean; - - procedure LoadExistingTest(CurrentTest: Code[20]; Update: Boolean) - begin - if Rec.Code <> CurrentTest then - if Rec.Get(CurrentTest) then; - Clear(MatrixMinValue); - Clear(MatrixMaxValue); - Clear(MatrixArrayConditionCellData); - Clear(MatrixArrayConditionDescriptionCellData); - Clear(MatrixArrayCaptionSet); - Clear(MatrixVisibleState); - - Clear(QltyTest); - if CurrentTest = '' then - exit; - - if not QltyTest.Get(CurrentTest) then begin - QltyTest.Init(); - QltyTest.Code := CurrentTest; - QltyTest.Insert(); - end; - QltyTest.SetRecFilter(); - UpdateRowData(); - if Update then - CurrPage.Update(false); - end; - - trigger OnInit() - begin - Visible1 := true; - Visible2 := true; - Visible3 := true; - Visible4 := true; - Visible5 := true; - Visible6 := true; - Visible7 := true; - Visible8 := true; - Visible9 := true; - Visible10 := true; - end; - - trigger OnAfterGetCurrRecord() - begin - UpdateRowData(); - end; - - local procedure UpdateRowData() - var - Iterator: Integer; - begin - Clear(MatrixMinValue); - Clear(MatrixMaxValue); - Clear(MatrixVisibleState); - Clear(MatrixArrayConditionCellData); - Clear(MatrixArrayConditionDescriptionCellData); - Clear(MatrixArrayCaptionSet); - - if QltyTest.Code = '' then - exit; - - QltyResultConditionMgmt.GetPromotedResultsForTest(QltyTest, MatrixSourceRecordId, MatrixArrayConditionCellData, MatrixArrayConditionDescriptionCellData, MatrixArrayCaptionSet, MatrixVisibleState); - for Iterator := 1 to ArrayLen(MatrixArrayConditionCellData) do - QltyMiscHelpers.AttemptSplitSimpleRangeIntoMinMax(MatrixArrayConditionCellData[Iterator], MatrixMinValue[Iterator], MatrixMaxValue[Iterator]); - - Visible1 := MatrixVisibleState[1]; - Visible2 := MatrixVisibleState[2]; - Visible3 := MatrixVisibleState[3]; - Visible4 := MatrixVisibleState[4]; - Visible5 := MatrixVisibleState[5]; - Visible6 := MatrixVisibleState[6]; - Visible7 := MatrixVisibleState[7]; - Visible8 := MatrixVisibleState[8]; - Visible9 := MatrixVisibleState[9]; - Visible10 := MatrixVisibleState[10]; - end; - - local procedure HandleTestValidateAdvancedSyntax(MatrixField: Integer) - var - QltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; - begin - QltyIResultConditConf.Get(MatrixSourceRecordId[MatrixField]); - QltyIResultConditConf.Validate(Condition, MatrixArrayConditionCellData[MatrixField]); - QltyMiscHelpers.AttemptSplitSimpleRangeIntoMinMax(QltyIResultConditConf.Condition, MatrixMinValue[MatrixField], MatrixMaxValue[MatrixField]); - QltyIResultConditConf.Modify(true); - LoadExistingTest(QltyTest.Code, true); - CurrPage.Update(false); - end; - - local procedure HandleTestValidateConditionDescription(MatrixField: Integer) - var - QltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; - begin - QltyIResultConditConf.Get(MatrixSourceRecordId[MatrixField]); - QltyIResultConditConf.Validate("Condition Description", MatrixArrayConditionDescriptionCellData[MatrixField]); - QltyIResultConditConf.Modify(true); - LoadExistingTest(QltyTest.Code, true); - CurrPage.Update(false); - end; -} diff --git a/src/Apps/W1/Quality Management/app/src/Permissions/QltyGeneral.PermissionSet.al b/src/Apps/W1/Quality Management/app/src/Permissions/QltyGeneral.PermissionSet.al index b762870411..97b56ba0e4 100644 --- a/src/Apps/W1/Quality Management/app/src/Permissions/QltyGeneral.PermissionSet.al +++ b/src/Apps/W1/Quality Management/app/src/Permissions/QltyGeneral.PermissionSet.al @@ -91,7 +91,6 @@ permissionset 20403 QltyGeneral page "Qlty. Manager RC" = X, page "Qlty. Test Card Part" = X, page "Qlty. Test Card" = X, - page "Qlty. Test Expr. Card Part" = X, page "Qlty. Test Lookup" = X, page "Qlty. Test Number Card Part" = X, page "Qlty. Test Wizard" = X, From 0053203249f1ef96eb499f45cabf256d2361b44f Mon Sep 17 00:00:00 2001 From: attilatoury Date: Wed, 4 Feb 2026 14:24:32 +0100 Subject: [PATCH 2/2] deleted obsolete tests --- .../test/src/QltyTestsMoreTests.Codeunit.al | 65 ------------------- 1 file changed, 65 deletions(-) diff --git a/src/Apps/W1/Quality Management/test/src/QltyTestsMoreTests.Codeunit.al b/src/Apps/W1/Quality Management/test/src/QltyTestsMoreTests.Codeunit.al index b8d83c4597..e9d0dc5f7a 100644 --- a/src/Apps/W1/Quality Management/test/src/QltyTestsMoreTests.Codeunit.al +++ b/src/Apps/W1/Quality Management/test/src/QltyTestsMoreTests.Codeunit.al @@ -219,36 +219,6 @@ codeunit 139965 "Qlty. Tests - More Tests" LibraryAssert.AreEqual(Vendor."No.", ToLoadQltyTest."Allowable Values", 'Should be same vendor no.') end; - [Test] - procedure TestTable_AssistEditExpressionFormula_ShouldError() - var - ToLoadQltyTest: Record "Qlty. Test"; - QltyTestExprCardPart: TestPage "Qlty. Test Expr. Card Part"; - TestCode: Text; - begin - // [SCENARIO] AssistEdit on Expression Formula should error when field type is Boolean - Initialize(); - - // [GIVEN] A random test code is generated - QltyInspectionUtility.GenerateRandomCharacters(20, TestCode); - - // [GIVEN] A new quality test with Test Value Type "Boolean" is created - ToLoadQltyTest.Validate(Code, CopyStr(TestCode, 1, MaxStrLen(ToLoadQltyTest.Code))); - ToLoadQltyTest.Validate(Description, LibraryUtility.GenerateRandomText(MaxStrLen(ToLoadQltyTest.Description))); - ToLoadQltyTest.Validate("Test Value Type", ToLoadQltyTest."Test Value Type"::"Value Type Boolean"); - ToLoadQltyTest.Insert(); - - // [GIVEN] The Quality Test Expression Card Part page is opened and navigated to the test - QltyTestExprCardPart.OpenEdit(); - QltyTestExprCardPart.GoToRecord(ToLoadQltyTest); - - // [WHEN] AssistEdit is invoked on the "Expression Formula" field for a Boolean type - asserterror QltyTestExprCardPart."Expression Formula".AssistEdit(); - - // [THEN] An error is raised indicating Expression Formula is only for Expression field types - LibraryAssert.ExpectedError(OnlyFieldExpressionErr); - end; - [Test] [HandlerFunctions('ModalPageHandleChooseFromLookup_VendorNo')] procedure TestTable_AssistEditDefaultValue_TypeTableLookup() @@ -296,41 +266,6 @@ codeunit 139965 "Qlty. Tests - More Tests" LibraryAssert.AreEqual(Vendor."No.", ToLoadQltyTest."Default Value", 'Should be same vendor no.') end; - [Test] - [HandlerFunctions('AssistEditTemplatePageHandler')] - procedure TestTable_AssistEditExpressionFormula() - var - ToLoadQltyTest: Record "Qlty. Test"; - QltyTestExprCardPart: TestPage "Qlty. Test Expr. Card Part"; - TestCode: Text; - begin - // [SCENARIO] User can use AssistEdit to define an expression formula for a Text Expression field type - Initialize(); - - // [GIVEN] A random test code is generated - QltyInspectionUtility.GenerateRandomCharacters(20, TestCode); - - // [GIVEN] A new quality test with Test Value Type "Text Expression" is created - ToLoadQltyTest.Validate(Code, CopyStr(TestCode, 1, MaxStrLen(ToLoadQltyTest.Code))); - ToLoadQltyTest.Validate(Description, LibraryUtility.GenerateRandomText(MaxStrLen(ToLoadQltyTest.Description))); - ToLoadQltyTest.Validate("Test Value Type", ToLoadQltyTest."Test Value Type"::"Value Type Text Expression"); - ToLoadQltyTest.Insert(); - - // [GIVEN] The Quality Test Expression Card Part page is opened and navigated to the test - QltyTestExprCardPart.OpenEdit(); - QltyTestExprCardPart.GoToRecord(ToLoadQltyTest); - - // [GIVEN] An expression formula value is prepared for the handler - AssistEditTemplateValue := ExpressionFormulaTok; - - // [WHEN] AssistEdit is invoked on the "Expression Formula" field - QltyTestExprCardPart."Expression Formula".AssistEdit(); - - // [THEN] The test's Expression Formula is updated with the prepared value - ToLoadQltyTest.Get(ToLoadQltyTest.Code); - LibraryAssert.AreEqual(ExpressionFormulaTok, ToLoadQltyTest."Expression Formula", 'Should be same expression formula.') - end; - [Test] procedure TestTable_ValidateTestValueType_ShouldError() var