diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json index 5586641bd5..1aea1d4fe5 100644 --- a/.github/AL-Go-Settings.json +++ b/.github/AL-Go-Settings.json @@ -6,7 +6,7 @@ "runs-on": "windows-latest", "cacheImageName": "", "UsePsSession": false, - "artifact": "bcinsider/Sandbox/28.0.45908.0//latest", + "artifact": "bcinsider/Sandbox/28.0.45995.0//latest", "country": "base", "useProjectDependencies": true, "repoVersion": "28.0", diff --git a/.github/workflows/CleanUpStalePRChecks.yaml b/.github/workflows/CleanUpStalePRChecks.yaml index 768e4e6451..6602b84b3a 100644 --- a/.github/workflows/CleanUpStalePRChecks.yaml +++ b/.github/workflows/CleanUpStalePRChecks.yaml @@ -21,7 +21,7 @@ jobs: name: Clean Up Stale PR Status Checks steps: - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Clean Up Stale PR Status Checks uses: ./.github/actions/CleanUpStalePRChecks diff --git a/.github/workflows/PowerShell.yaml b/.github/workflows/PowerShell.yaml index b239069906..ebeda7afb0 100644 --- a/.github/workflows/PowerShell.yaml +++ b/.github/workflows/PowerShell.yaml @@ -22,7 +22,7 @@ jobs: security-events: write # for github/codeql-action/upload-sarif to upload SARIF results steps: - name: Harden Runner - uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1 + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 with: egress-policy: audit diff --git a/.github/workflows/UpdateALGoProjects.yaml b/.github/workflows/UpdateALGoProjects.yaml index d885aad527..1fb06332fc 100644 --- a/.github/workflows/UpdateALGoProjects.yaml +++ b/.github/workflows/UpdateALGoProjects.yaml @@ -20,7 +20,7 @@ jobs: updateBranches: ${{ steps.getOfficialBranches.outputs.branchesJson }} steps: - name: Harden Runner - uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1 + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 with: egress-policy: audit diff --git a/.github/workflows/UpdateBCArtifactVersion.yaml b/.github/workflows/UpdateBCArtifactVersion.yaml index fcf7a99b43..2eb6339fb6 100644 --- a/.github/workflows/UpdateBCArtifactVersion.yaml +++ b/.github/workflows/UpdateBCArtifactVersion.yaml @@ -20,7 +20,7 @@ jobs: updateBranches: ${{ steps.getOfficialBranches.outputs.branchesJson }} steps: - name: Harden Runner - uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1 + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 with: egress-policy: audit diff --git a/.github/workflows/UpdatePackageVersions.yaml b/.github/workflows/UpdatePackageVersions.yaml index c4a83e9382..a9b54787f4 100644 --- a/.github/workflows/UpdatePackageVersions.yaml +++ b/.github/workflows/UpdatePackageVersions.yaml @@ -20,7 +20,7 @@ jobs: updateBranches: ${{ steps.getOfficialBranches.outputs.branchesJson }} steps: - name: Harden Runner - uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1 + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 with: egress-policy: audit diff --git a/.github/workflows/WorkitemValidation.yaml b/.github/workflows/WorkitemValidation.yaml index 1b2f38a4a8..5a44d87cae 100644 --- a/.github/workflows/WorkitemValidation.yaml +++ b/.github/workflows/WorkitemValidation.yaml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1 + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 with: egress-policy: audit @@ -40,7 +40,7 @@ jobs: needs: GitHubIssueValidation steps: - name: Harden Runner - uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1 + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 with: egress-policy: audit diff --git a/.github/workflows/scorecard-analysis.yml b/.github/workflows/scorecard-analysis.yml index 9b172c2552..fd636d0fcd 100644 --- a/.github/workflows/scorecard-analysis.yml +++ b/.github/workflows/scorecard-analysis.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1 + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 with: egress-policy: audit diff --git a/build/Packages.json b/build/Packages.json index b476becc36..8abf9ad64b 100644 --- a/build/Packages.json +++ b/build/Packages.json @@ -1,10 +1,10 @@ { "Microsoft.Dynamics.BusinessCentral.Translations": { - "Version": "28.0.26033.2", + "Version": "28.0.26041.1", "Source": "NuGet.org" }, "AppBaselines-BCArtifacts": { - "Version": "27.4.45544.0", + "Version": "27.5.45994.0", "Source": "BCArtifacts", "_comment": "Used to fetch app baselines from BC artifacts" } diff --git a/src/Apps/W1/EDocument/App/src/Document/EDocumentSourceType.Enum.al b/src/Apps/W1/EDocument/App/src/Document/EDocumentSourceType.Enum.al index 2e6a4fbd37..7572ab4e06 100644 --- a/src/Apps/W1/EDocument/App/src/Document/EDocumentSourceType.Enum.al +++ b/src/Apps/W1/EDocument/App/src/Document/EDocumentSourceType.Enum.al @@ -12,4 +12,5 @@ enum 6123 "E-Document Source Type" value(0; Customer) { Caption = 'Customer'; } value(1; Vendor) { Caption = 'Vendor'; } value(2; Location) { Caption = 'Location'; } + value(3; Company) { Caption = 'Company'; } } diff --git a/src/Apps/W1/EDocument/App/src/Extensions/EDocCompanyInformation.PageExt.al b/src/Apps/W1/EDocument/App/src/Extensions/EDocCompanyInformation.PageExt.al new file mode 100644 index 0000000000..897c2f6f22 --- /dev/null +++ b/src/Apps/W1/EDocument/App/src/Extensions/EDocCompanyInformation.PageExt.al @@ -0,0 +1,59 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ + +namespace Microsoft.eServices.EDocument.Extensions; + +using Microsoft.eServices.EDocument; +using Microsoft.eServices.EDocument.Service.Participant; +using Microsoft.Foundation.Company; + +/// +/// A page extension for the Company Information page to show the E-Document service participation. +/// +pageextension 6165 "E-Doc. Company Information" extends "Company Information" +{ + layout + { + addafter(GLN) + { + field("E-Document Service Participation Ids"; ParticipantIdCount) + { + ApplicationArea = All; + Caption = 'E-Document Service Participation'; + DrillDown = true; + Editable = false; + ToolTip = 'Specifies the company participation for the E-Document services.'; + Visible = EDocumentServiceExists; + + trigger OnDrillDown() + begin + ServiceParticipant.RunServiceParticipantPage(Enum::"E-Document Source Type"::Company, ''); + end; + } + } + } + + + var + ServiceParticipant: Codeunit "Service Participant"; + ParticipantIdCount: Integer; + EDocumentServiceExists: Boolean; + + + trigger OnAfterGetCurrRecord() + begin + if TryGetEDocumentServiceParticipation() then; + end; + + [TryFunction] + local procedure TryGetEDocumentServiceParticipation() + var + EDocumentService: Record "E-Document Service"; + begin + EDocumentServiceExists := not EDocumentService.IsEmpty(); + ParticipantIdCount := ServiceParticipant.GetParticipantIdCount(Enum::"E-Document Source Type"::Company, ''); + end; + +} diff --git a/src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al b/src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al index 02abadb0af..e08ba1d533 100644 --- a/src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al +++ b/src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al @@ -256,6 +256,21 @@ codeunit 6109 "E-Document Import Helper" LineDiscountAmountFieldRef.Value(LineDiscountAmount); end; + /// + /// Use it to check if receiving company information is in line with Company Information. + /// Also checks if the Receiving Company Id matches a Company Service Participant. + /// + /// The E-Document record. + /// The E-Document Service record to match against. + procedure ValidateReceivingCompanyInfo(EDocument: Record "E-Document"; EDocService: Record "E-Document Service") + begin + // First, check if the Receiving Company Id matches a Company Service Participant + if MatchCompanyByServiceParticipant(EDocument, EDocService) then + exit; + + ValidateReceivingCompanyInfo(EDocument); + end; + /// /// Use it to check if receiving company information is in line with Company Information. /// @@ -281,6 +296,25 @@ codeunit 6109 "E-Document Import Helper" EDocErrorHelper.LogErrorMessage(EDocument, CompanyInformation, CompanyInformation.FieldNo("VAT Registration No."), StrSubstNo(InvalidCompanyInfoVATRegNoErr, EDocument."Receiving Company VAT Reg. No.")); end; + /// + /// Use it to check if receiving company information matches a Company Service Participant for a specific service. + /// + /// The E-Document record. + /// The E-Document Service record to match against. + /// True if a matching Company Service Participant is found. + local procedure MatchCompanyByServiceParticipant(EDocument: Record "E-Document"; EDocService: Record "E-Document Service"): Boolean + var + ServiceParticipant: Record "Service Participant"; + begin + if EDocument."Receiving Company Id" = '' then + exit(false); + + ServiceParticipant.SetRange("Participant Type", ServiceParticipant."Participant Type"::Company); + ServiceParticipant.SetRange("Participant Identifier", EDocument."Receiving Company Id"); + ServiceParticipant.SetRange(Service, EDocService.Code); + exit(not ServiceParticipant.IsEmpty()); + end; + /// /// Use it to check if receiving company name and address is in line with Company Information. /// diff --git a/src/Apps/W1/EDocument/App/src/Processing/EDocImport.Codeunit.al b/src/Apps/W1/EDocument/App/src/Processing/EDocImport.Codeunit.al index fdef5b55ef..1250c522f3 100644 --- a/src/Apps/W1/EDocument/App/src/Processing/EDocImport.Codeunit.al +++ b/src/Apps/W1/EDocument/App/src/Processing/EDocImport.Codeunit.al @@ -282,7 +282,7 @@ codeunit 6140 "E-Doc. Import" EDocErrorHelper.LogWarningMessage(EDocument, EDocument2, EDocument2.FieldNo("Incoming E-Document No."), DocAlreadyExistsMsg); if EDocService."Validate Receiving Company" then - EDocImportHelper.ValidateReceivingCompanyInfo(EDocument); + EDocImportHelper.ValidateReceivingCompanyInfo(EDocument, EDocService); end else EDocErrorHelper.LogSimpleErrorMessage(EDocument, GetLastErrorText()); diff --git a/src/Apps/W1/EDocument/Test/src/Receive/EDocHelperTest.Codeunit.al b/src/Apps/W1/EDocument/Test/src/Receive/EDocHelperTest.Codeunit.al index bf0a7b4f51..4a33a43c12 100644 --- a/src/Apps/W1/EDocument/Test/src/Receive/EDocHelperTest.Codeunit.al +++ b/src/Apps/W1/EDocument/Test/src/Receive/EDocHelperTest.Codeunit.al @@ -5,15 +5,21 @@ namespace Microsoft.eServices.EDocument.Test; using Microsoft.eServices.EDocument; +using Microsoft.eServices.EDocument.Integration; +using Microsoft.eServices.EDocument.Service.Participant; +using Microsoft.Foundation.Company; using Microsoft.Purchases.Document; codeunit 139799 "E-Doc. Helper Test" { Subtype = Test; Access = Internal; + TestPermissions = Disabled; var Assert: Codeunit "Assert"; + LibraryEDoc: Codeunit "Library - E-Document"; + LibraryLowerPermission: Codeunit "Library - Lower Permissions"; trigger OnRun() begin @@ -48,4 +54,82 @@ codeunit 139799 "E-Doc. Helper Test" VendorNo := EDocumentImportHelper.FindVendor('', '', ''); Assert.IsTrue(VendorNo = '', 'Vendor No. should be empty'); end; + + [Test] + procedure ValidateReceivingCompanyInfoWithMatchingServiceParticipant() + var + EDocument: Record "E-Document"; + EDocService: Record "E-Document Service"; + ServiceParticipant: Record "Service Participant"; + EDocumentImportHelper: Codeunit "E-Document Import Helper"; + EDocErrorHelper: Codeunit "E-Document Error Helper"; + TestParticipantId: Text[200]; + begin + LibraryLowerPermission.SetOutsideO365Scope(); + // [SCENARIO] Validation should succeed when a matching Company Service Participant exists + // [GIVEN] An E-Document with a Receiving Company Id + TestParticipantId := '0208:1234567890'; + EDocument.Init(); + EDocument."Entry No" := 0; + EDocument."Receiving Company Id" := TestParticipantId; + EDocument."Receiving Company GLN" := ''; + EDocument."Receiving Company VAT Reg. No." := ''; + EDocument.Insert(true); + + // [GIVEN] An E-Document Service + LibraryEDoc.CreateTestReceiveServiceForEDoc(EDocService, Enum::"Service Integration"::"Mock"); + + // [GIVEN] A matching Company Service Participant + ServiceParticipant.Init(); + ServiceParticipant.Service := EDocService.Code; + ServiceParticipant."Participant Type" := ServiceParticipant."Participant Type"::Company; + ServiceParticipant.Participant := ''; + ServiceParticipant."Participant Identifier" := TestParticipantId; + ServiceParticipant.Insert(true); + + // [WHEN] Validating receiving company info + EDocumentImportHelper.ValidateReceivingCompanyInfo(EDocument, EDocService); + + // [THEN] No errors should be logged (validation should exit early due to Service Participant match) + Assert.IsFalse(EDocErrorHelper.HasErrors(EDocument), 'No errors should be logged when Service Participant matches'); + + // Cleanup + ServiceParticipant.Delete(); + EDocument.Delete(); + end; + + [Test] + procedure ValidateReceivingCompanyInfoFallsBackToVATWhenNoServiceParticipant() + var + EDocument: Record "E-Document"; + EDocService: Record "E-Document Service"; + CompanyInformation: Record "Company Information"; + EDocumentImportHelper: Codeunit "E-Document Import Helper"; + EDocErrorHelper: Codeunit "E-Document Error Helper"; + begin + LibraryLowerPermission.SetOutsideO365Scope(); + // [SCENARIO] Validation should fall back to VAT/GLN matching when no Service Participant exists + // [GIVEN] An E-Document with a Receiving Company Id that doesn't match any Service Participant + // [GIVEN] But has matching VAT Registration No. + CompanyInformation.Get(); + + EDocument.Init(); + EDocument."Entry No" := 0; + EDocument."Receiving Company Id" := '0208:NOMATCH'; + EDocument."Receiving Company VAT Reg. No." := CompanyInformation."VAT Registration No."; + EDocument."Receiving Company GLN" := ''; + EDocument.Insert(true); + + // [GIVEN] An E-Document Service with no matching Company Service Participant + LibraryEDoc.CreateTestReceiveServiceForEDoc(EDocService, Enum::"Service Integration"::"Mock"); + + // [WHEN] Validating receiving company info + EDocumentImportHelper.ValidateReceivingCompanyInfo(EDocument, EDocService); + + // [THEN] No errors should be logged (validation should succeed via VAT matching) + Assert.IsFalse(EDocErrorHelper.HasErrors(EDocument), 'No errors should be logged when VAT Registration No. matches'); + + // Cleanup + EDocument.Delete(); + end; } \ No newline at end of file diff --git a/src/Apps/W1/Quality Management/Test Library/src/QltyInspectionUtility.Codeunit.al b/src/Apps/W1/Quality Management/Test Library/src/QltyInspectionUtility.Codeunit.al index c1ae88fc71..27efc98a9f 100644 --- a/src/Apps/W1/Quality Management/Test Library/src/QltyInspectionUtility.Codeunit.al +++ b/src/Apps/W1/Quality Management/Test Library/src/QltyInspectionUtility.Codeunit.al @@ -2398,6 +2398,17 @@ codeunit 139940 "Qlty. Inspection Utility" exit(QltyExpressionMgmt.EvaluateExpressionForRecord(Input, RecordVariant, EvaluateEmbeddedExpressions)); end; + /// + /// Wrapper for QltyExpressionMgmt.TestEvaluateSpecialStringFunctions + /// Used for validation of special string function syntax. + /// + internal procedure TestEvaluateSpecialStringFunctions(Input: Text): Text + var + QltyExpressionMgmt: Codeunit "Qlty. Expression Mgmt."; + begin + exit(QltyExpressionMgmt.TestEvaluateSpecialStringFunctions(Input)); + end; + #endregion Qlty. Expression Mgmt. Wrappers #region Qlty. Result Evaluation Wrappers @@ -2461,4 +2472,41 @@ codeunit 139940 "Qlty. Inspection Utility" end; #endregion Qlty. Disp. Move Auto Choose Wrappers + + #region Qlty. Item Tracking Wrappers + + /// + /// Wrapper for QltyItemTracking.SetLotBlockState + /// Sets the lot block state for an inspection. + /// + internal procedure SetLotBlockState(QltyInspectionHeader: Record "Qlty. Inspection Header"; Blocked: Boolean) + var + QltyItemTracking: Codeunit "Qlty. Item Tracking"; + begin + QltyItemTracking.SetLotBlockState(QltyInspectionHeader, Blocked); + end; + + /// + /// Wrapper for QltyItemTracking.SetSerialBlockState + /// Sets the serial block state for an inspection. + /// + internal procedure SetSerialBlockState(QltyInspectionHeader: Record "Qlty. Inspection Header"; Blocked: Boolean) + var + QltyItemTracking: Codeunit "Qlty. Item Tracking"; + begin + QltyItemTracking.SetSerialBlockState(QltyInspectionHeader, Blocked); + end; + + /// + /// Wrapper for QltyItemTracking.SetPackageBlockState + /// Sets the package block state for an inspection. + /// + internal procedure SetPackageBlockState(QltyInspectionHeader: Record "Qlty. Inspection Header"; Blocked: Boolean) + var + QltyItemTracking: Codeunit "Qlty. Item Tracking"; + begin + QltyItemTracking.SetPackageBlockState(QltyInspectionHeader, Blocked); + end; + + #endregion Qlty. Item Tracking Wrappers } diff --git a/src/Apps/W1/Quality Management/app/src/Configuration/Result/QltyResultEvaluation.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Configuration/Result/QltyResultEvaluation.Codeunit.al index 9b5c25a8cf..ad9be48454 100644 --- a/src/Apps/W1/Quality Management/app/src/Configuration/Result/QltyResultEvaluation.Codeunit.al +++ b/src/Apps/W1/Quality Management/app/src/Configuration/Result/QltyResultEvaluation.Codeunit.al @@ -60,7 +60,7 @@ codeunit 20410 "Qlty. Result Evaluation" /// /// /// - procedure EvaluateResult(var OptionalQltyInspectionHeader: Record "Qlty. Inspection Header"; var OptionalQltyInspectionLine: Record "Qlty. Inspection Line"; var QltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; QltyTestValueType: Enum "Qlty. Test Value Type"; TestValue: Text; QltyCaseSensitivity: Enum "Qlty. Case Sensitivity") Result: Code[20] + internal procedure EvaluateResult(var OptionalQltyInspectionHeader: Record "Qlty. Inspection Header"; var OptionalQltyInspectionLine: Record "Qlty. Inspection Line"; var QltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; QltyTestValueType: Enum "Qlty. Test Value Type"; TestValue: Text; QltyCaseSensitivity: Enum "Qlty. Case Sensitivity") Result: Code[20] var QltyInspectionResult: Record "Qlty. Inspection Result"; TempHighestQltyIResultConditConf: Record "Qlty. I. Result Condit. Conf." temporary; @@ -481,7 +481,7 @@ codeunit 20410 "Qlty. Result Evaluation" Result := AcceptableValue in [IsDefaultNumberTok, IsDefaultTextTok]; end; - procedure CheckIfValueIsDateTime(var ValueToCheck: Text[250]; AcceptableValue: Text; AdjustValueIfGood: Boolean) IsGood: Boolean + internal procedure CheckIfValueIsDateTime(var ValueToCheck: Text[250]; AcceptableValue: Text; AdjustValueIfGood: Boolean) IsGood: Boolean var TempQltyInspectionHeader: Record "Qlty. Inspection Header" temporary; ValueAsDateTime: DateTime; @@ -525,7 +525,7 @@ codeunit 20410 "Qlty. Result Evaluation" exit(IsGood); end; - procedure CheckIfValueIsDate(var ValueToCheck: Text[250]; AcceptableValue: Text; AdjustValueIfGood: Boolean) IsGood: Boolean + internal procedure CheckIfValueIsDate(var ValueToCheck: Text[250]; AcceptableValue: Text; AdjustValueIfGood: Boolean) IsGood: Boolean var TempDateLookupBuffer: Record "Date Lookup Buffer" temporary; ValueAsDate: Date; diff --git a/src/Apps/W1/Quality Management/app/src/Configuration/Template/QltyInspectionCopyTemplate.Report.al b/src/Apps/W1/Quality Management/app/src/Configuration/Template/QltyInspectionCopyTemplate.Report.al index be94e5bb4b..3816288082 100644 --- a/src/Apps/W1/Quality Management/app/src/Configuration/Template/QltyInspectionCopyTemplate.Report.al +++ b/src/Apps/W1/Quality Management/app/src/Configuration/Template/QltyInspectionCopyTemplate.Report.al @@ -24,7 +24,7 @@ report 20402 "Qlty. Inspection Copy Template" { MaxIteration = 1; RequestFilterFields = Code, Description; - RequestFilterHeading = 'An Existing Quality Inspection Template to copy from'; + RequestFilterHeading = 'Quality Inspection Template to copy from'; trigger OnPreDataItem() begin @@ -42,7 +42,7 @@ report 20402 "Qlty. Inspection Copy Template" { RequestFilterFields = "No.", Description, "Description 2", "Lot Nos."; DataItemTableView = sorting("No.") where("No." = filter(<> '')); - RequestFilterHeading = 'Item Nos. to use To Create Template codes for (Enable Create from Item Nos. first)'; + RequestFilterHeading = 'Item numbers to use for creating template codes'; trigger OnAfterGetRecord() begin diff --git a/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestCardPart.Page.al b/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestCardPart.Page.al index b7f8b21ff3..5615c78b20 100644 --- a/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestCardPart.Page.al +++ b/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestCardPart.Page.al @@ -175,16 +175,5 @@ page 20437 "Qlty. Test Card Part" Rec."Test Value Type"::"Value Type Boolean", Rec."Test Value Type"::"Value Type Text"]); IsNumber := Rec.IsNumericFieldType(); - - OnAfterUpdateControlVisibilityState(Rec); - end; - - /// - /// Use this to update the control visibility state with any page extensions. - /// - /// - [IntegrationEvent(true, false)] - local procedure OnAfterUpdateControlVisibilityState(var QltyTest: Record "Qlty. Test") - begin end; } diff --git a/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestWizard.Page.al b/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestWizard.Page.al index 63b76b3e56..0422c645e7 100644 --- a/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestWizard.Page.al +++ b/src/Apps/W1/Quality Management/app/src/Configuration/Template/Test/QltyTestWizard.Page.al @@ -366,7 +366,7 @@ page 20432 "Qlty. Test Wizard" IsMovingForward := Step > CurrentStepCounter; if IsMovingForward then - LeavingStepMovingForward(CurrentStepCounter, Step); + LeavingStepMovingForward(CurrentStepCounter); EvaluateStep(Step); CurrentStepCounter := Step; @@ -375,7 +375,6 @@ page 20432 "Qlty. Test Wizard" local procedure EvaluateStep(Step: Integer) begin - OnBeforeEvaluateStep(Step, IsBackEnabled, IsNextEnabled, IsFinishEnabled); case Step of Step1NewOrExisting: begin @@ -413,9 +412,8 @@ page 20432 "Qlty. Test Wizard" CurrPage."Qlty. Choose Existing Tests".Page.GetTestsToAdd(TestsToAdd); end; - local procedure LeavingStepMovingForward(LeavingThisStep: Integer; var MovingToStep: Integer); + local procedure LeavingStepMovingForward(LeavingThisStep: Integer); begin - OnBeforeLeavingStepMovingForward(LeavingThisStep, MovingToStep); case LeavingThisStep of Step2AddNewTest: AddOrUpdateInternalField(); @@ -440,7 +438,6 @@ page 20432 "Qlty. Test Wizard" begin FinishActionChosen := true; AddOrUpdateInternalField(); - OnFinishActionOnAfterAddUpdateInternalField(); AddedOrChooseATest := NewTest or EditingExistingTest or (ChooseExistingTestOrTests and (TestsToAdd.Count() > 0)); if AddedOrChooseATest and NewTest then @@ -624,18 +621,4 @@ page 20432 "Qlty. Test Wizard" end; end; - [IntegrationEvent(false, false)] - local procedure OnBeforeLeavingStepMovingForward(LeavingThisStep: Integer; var MovingToStep: Integer); - begin - end; - - [IntegrationEvent(false, false)] - local procedure OnBeforeEvaluateStep(Step: Integer; var IsBackEnabled: Boolean; var IsNextEnabled: Boolean; var IsFinishEnabled: Boolean) - begin - end; - - [IntegrationEvent(false, false)] - local procedure OnFinishActionOnAfterAddUpdateInternalField() - begin - end; } diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Inventory/QltyItemTracking.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Integration/Inventory/QltyItemTracking.Codeunit.al index fc61ef7ffa..48aaebfc5b 100644 --- a/src/Apps/W1/Quality Management/app/src/Integration/Inventory/QltyItemTracking.Codeunit.al +++ b/src/Apps/W1/Quality Management/app/src/Integration/Inventory/QltyItemTracking.Codeunit.al @@ -30,7 +30,7 @@ codeunit 20428 "Qlty. Item Tracking" /// /// /// - procedure SetLotBlockState(QltyInspectionHeader: Record "Qlty. Inspection Header"; Blocked: Boolean) + internal procedure SetLotBlockState(QltyInspectionHeader: Record "Qlty. Inspection Header"; Blocked: Boolean) var LotNoInformation: Record "Lot No. Information"; QltyNotificationMgmt: Codeunit "Qlty. Notification Mgmt."; @@ -63,7 +63,7 @@ codeunit 20428 "Qlty. Item Tracking" /// /// /// - procedure SetSerialBlockState(QltyInspectionHeader: Record "Qlty. Inspection Header"; Blocked: Boolean) + internal procedure SetSerialBlockState(QltyInspectionHeader: Record "Qlty. Inspection Header"; Blocked: Boolean) var SerialNoInformation: Record "Serial No. Information"; QltyNotificationMgmt: Codeunit "Qlty. Notification Mgmt."; @@ -96,7 +96,7 @@ codeunit 20428 "Qlty. Item Tracking" /// /// /// - procedure SetPackageBlockState(QltyInspectionHeader: Record "Qlty. Inspection Header"; Blocked: Boolean) + internal procedure SetPackageBlockState(QltyInspectionHeader: Record "Qlty. Inspection Header"; Blocked: Boolean) var PackageNoInformation: Record "Package No. Information"; QltyNotificationMgmt: Codeunit "Qlty. Notification Mgmt."; diff --git a/src/Apps/W1/Quality Management/app/src/Reports/QltyReportSelectionQM.Page.al b/src/Apps/W1/Quality Management/app/src/Reports/QltyReportSelectionQM.Page.al index af3da808d3..7f4b9882a9 100644 --- a/src/Apps/W1/Quality Management/app/src/Reports/QltyReportSelectionQM.Page.al +++ b/src/Apps/W1/Quality Management/app/src/Reports/QltyReportSelectionQM.Page.al @@ -104,19 +104,7 @@ page 20442 "Qlty. Report Selection - QM" Rec.SetRange(Usage, Rec."Usage"::"Quality Management - General Purpose Inspection"); end; - OnSetUsageFilterOnAfterSetFiltersByReportUsage(Rec, QltyReportSelectionUsage); Rec.FilterGroup(0); CurrPage.Update(); end; - - /// - /// OnSetUsageFilterOnAfterSetFiltersByReportUsage gives an opportunity to extend the report usage filtering. - /// - /// var Record "Report Selections". - /// Enum "Qlty. Report Selection Usage". - - [IntegrationEvent(false, false)] - local procedure OnSetUsageFilterOnAfterSetFiltersByReportUsage(var ReportSelections: Record "Report Selections"; ReportSelectionUsage: Enum "Qlty. Report Selection Usage") - begin - end; } diff --git a/src/Apps/W1/Quality Management/app/src/Utilities/QltyExpressionMgmt.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Utilities/QltyExpressionMgmt.Codeunit.al index deb8ca10fc..298880c9da 100644 --- a/src/Apps/W1/Quality Management/app/src/Utilities/QltyExpressionMgmt.Codeunit.al +++ b/src/Apps/W1/Quality Management/app/src/Utilities/QltyExpressionMgmt.Codeunit.al @@ -61,7 +61,7 @@ codeunit 20416 "Qlty. Expression Mgmt." /// The inspection line containing the expression to evaluate /// The inspection header providing context for evaluation /// The evaluated text result - procedure EvaluateTextExpression(var QltyInspectionLine: Record "Qlty. Inspection Line"; CurrentQltyInspectionHeader: Record "Qlty. Inspection Header") Result: Text + internal procedure EvaluateTextExpression(var QltyInspectionLine: Record "Qlty. Inspection Line"; CurrentQltyInspectionHeader: Record "Qlty. Inspection Header") Result: Text var QltyInspectionTemplateLine: Record "Qlty. Inspection Template Line"; Value: Text; @@ -100,7 +100,7 @@ codeunit 20416 "Qlty. Expression Mgmt." /// The text expression containing [FieldName] tokens to replace /// If the inspection doesn't exist pass in a blank empty temporary record instead. /// The evaluated text with tokens replaced by actual values - procedure EvaluateTextExpression(Input: Text; CurrentQltyInspectionHeader: Record "Qlty. Inspection Header"): Text + internal procedure EvaluateTextExpression(Input: Text; CurrentQltyInspectionHeader: Record "Qlty. Inspection Header"): Text var TempDummyQltyInspectionLine: Record "Qlty. Inspection Line" temporary; begin @@ -119,7 +119,7 @@ codeunit 20416 "Qlty. Expression Mgmt." /// If the inspection doesn't exist pass in a blank empty temporary record instead. /// If the inspection line doesn't exist pass in a blank empty temporary record instead. /// The evaluated text with tokens replaced by actual values - procedure EvaluateTextExpression(Input: Text; CurrentQltyInspectionHeader: Record "Qlty. Inspection Header"; CurrentQltyInspectionLine: Record "Qlty. Inspection Line"): Text + internal procedure EvaluateTextExpression(Input: Text; CurrentQltyInspectionHeader: Record "Qlty. Inspection Header"; CurrentQltyInspectionLine: Record "Qlty. Inspection Line"): Text begin exit(EvaluateTextExpression(Input, CurrentQltyInspectionHeader, CurrentQltyInspectionLine, false)); end; @@ -158,7 +158,7 @@ codeunit 20416 "Qlty. Expression Mgmt." /// When supplied, a specific inspection line providing additional context /// True to evaluate {expression} patterns; False to skip /// The fully evaluated text result - procedure EvaluateTextExpression(Input: Text; CurrentQltyInspectionHeader: Record "Qlty. Inspection Header"; SpecificQltyInspectionLine: Record "Qlty. Inspection Line"; EvaluateEmbeddedNumericExpressions: Boolean) Result: Text + internal procedure EvaluateTextExpression(Input: Text; CurrentQltyInspectionHeader: Record "Qlty. Inspection Header"; SpecificQltyInspectionLine: Record "Qlty. Inspection Line"; EvaluateEmbeddedNumericExpressions: Boolean) Result: Text var InputCurrentQltyInspectionLine: Record "Qlty. Inspection Line"; QltyInspectionTemplateLine: Record "Qlty. Inspection Template Line"; @@ -210,7 +210,7 @@ codeunit 20416 "Qlty. Expression Mgmt." /// /// Set to true to use localization format, set to false to not format. /// - procedure EvaluateExpressionForRecord(Input: Text; RecordVariant: Variant; FormatText: Boolean) Result: Text + internal procedure EvaluateExpressionForRecord(Input: Text; RecordVariant: Variant; FormatText: Boolean) Result: Text var TempQltyInspectionHeader: Record "Qlty. Inspection Header" temporary; QltyMiscHelpers: Codeunit "Qlty. Misc Helpers"; @@ -349,7 +349,7 @@ codeunit 20416 "Qlty. Expression Mgmt." /// /// The text expression containing special functions to validate /// The text with validated function syntax (not fully evaluated) - procedure TestEvaluateSpecialStringFunctions(Input: Text): Text + internal procedure TestEvaluateSpecialStringFunctions(Input: Text): Text var TempCurrentQltyInspectionHeader: Record "Qlty. Inspection Header" temporary; TempDummyCurrentQltyInspectionLine: Record "Qlty. Inspection Line" temporary; diff --git a/src/Apps/W1/Quality Management/app/src/Utilities/QltyMiscHelpers.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Utilities/QltyMiscHelpers.Codeunit.al index b25183d3f1..beaf3ac4f1 100644 --- a/src/Apps/W1/Quality Management/app/src/Utilities/QltyMiscHelpers.Codeunit.al +++ b/src/Apps/W1/Quality Management/app/src/Utilities/QltyMiscHelpers.Codeunit.al @@ -95,12 +95,8 @@ codeunit 20599 "Qlty. Misc Helpers" internal procedure GetDefaultMaximumRowsFieldLookup() ResultRowsCount: Integer var QltyManagementSetup: Record "Qlty. Management Setup"; - IsHandled: Boolean; begin ResultRowsCount := DefaultMaxRowsFieldLookup(); - OnBeforeGetDefaultMaximumRowsToShowInLookup(ResultRowsCount, IsHandled); - if IsHandled then - exit; if not QltyManagementSetup.GetSetupRecord() then exit; @@ -772,7 +768,6 @@ codeunit 20599 "Qlty. Misc Helpers" /// Automatically determines the correct page to display based on the source record type. /// /// Behavior: - /// - Fires OnBeforeNavigateToSourceDocument event for extensibility /// - Exits if no source document is linked (Source RecordId is empty) /// - Uses Page Management to find the appropriate page for the record type /// - Opens the page in modal mode displaying the source document @@ -787,12 +782,7 @@ codeunit 20599 "Qlty. Misc Helpers" RecordRefToNavigateTo: RecordRef; VariantContainer: Variant; CurrentPage: Integer; - IsHandled: Boolean; begin - OnBeforeNavigateToSourceDocument(QltyInspectionHeader, IsHandled); - if IsHandled then - exit; - if QltyInspectionHeader."Source RecordId".TableNo() = 0 then exit; @@ -948,26 +938,4 @@ codeunit 20599 "Qlty. Misc Helpers" exit(RecordRef.Number() <> 0); end; - - /// - /// Provides an ability to override the handling of navigating to a source document. - /// - /// - /// - [IntegrationEvent(false, false)] - local procedure OnBeforeNavigateToSourceDocument(var QltyInspectionHeader: Record "Qlty. Inspection Header"; var IsHandled: Boolean) - begin - end; - - /// - /// Provides an opportunity for customizations to alter the default maximum rows shown - /// for a table lookup in a quality inspector field. - /// Changing the default to a larger number can introduce performance issues. - /// - /// - /// - [IntegrationEvent(false, false)] - local procedure OnBeforeGetDefaultMaximumRowsToShowInLookup(var Rows: Integer; var IsHandled: Boolean) - begin - end; } diff --git a/src/Apps/W1/Quality Management/app/src/Utilities/QltyNotificationMgmt.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Utilities/QltyNotificationMgmt.Codeunit.al index 739e85223f..6ebb8be79d 100644 --- a/src/Apps/W1/Quality Management/app/src/Utilities/QltyNotificationMgmt.Codeunit.al +++ b/src/Apps/W1/Quality Management/app/src/Utilities/QltyNotificationMgmt.Codeunit.al @@ -565,12 +565,7 @@ codeunit 20437 "Qlty. Notification Mgmt." var ActionMessage: Text; ActionProcedureCallback: Text; - IsHandled: Boolean; begin - OnBeforeCreateActionNotification(NotificationToShow, CurrentMessage, AvailableOptions, IsHandled); - if IsHandled then - exit; - NotificationToShow.Message(CurrentMessage); foreach ActionMessage in AvailableOptions.Keys do if AvailableOptions.Get(ActionMessage, ActionProcedureCallback) then @@ -654,16 +649,4 @@ codeunit 20437 "Qlty. Notification Mgmt." begin exit('f2e838e8-c3c3-4ce2-ab34-cde0a3a3cb1f'); end; - - /// - /// Use this to supplment, extend, or replace base action handling. - /// - /// - /// - /// - /// - [IntegrationEvent(false, false)] - local procedure OnBeforeCreateActionNotification(var NotificationToShow: Notification; var CurrentMessage: Text; var AvailableOptions: Dictionary of [Text, Text]; var IsHandled: Boolean) - begin - end; } diff --git a/src/Apps/W1/Quality Management/test/src/QltyTestsExpressions.Codeunit.al b/src/Apps/W1/Quality Management/test/src/QltyTestsExpressions.Codeunit.al index bea2f704e9..6df2ea5f13 100644 --- a/src/Apps/W1/Quality Management/test/src/QltyTestsExpressions.Codeunit.al +++ b/src/Apps/W1/Quality Management/test/src/QltyTestsExpressions.Codeunit.al @@ -9,7 +9,6 @@ using Microsoft.Inventory.Location; using Microsoft.QualityManagement.Configuration.GenerationRule; using Microsoft.QualityManagement.Configuration.Template; using Microsoft.QualityManagement.Document; -using Microsoft.QualityManagement.Utilities; using Microsoft.Test.QualityManagement.TestLibraries; using System.TestLibraries.Utilities; @@ -21,6 +20,7 @@ codeunit 139961 "Qlty. Tests - Expressions" var LibraryAssert: Codeunit "Library Assert"; + QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; LookupExpressionTok: Label '[LOOKUP(Location;Code;Name=%1)]', Comment = '%1=the location name', Locked = true; LocationNameTok: Label 'Test Location'; TemplateTok: Label '[template code]', Locked = true; @@ -42,7 +42,6 @@ codeunit 139961 "Qlty. Tests - Expressions" var TempIgnoredQltyInspectionHeader: Record "Qlty. Inspection Header" temporary; TempIgnoredQltyInspectionLine: Record "Qlty. Inspection Line" temporary; - QltyExpressionMgmt: Codeunit "Qlty. Expression Mgmt."; begin // [SCENARIO] Validate basic text expression evaluation with field name substitution @@ -53,9 +52,9 @@ codeunit 139961 "Qlty. Tests - Expressions" // [WHEN] Text expression is evaluated with field name placeholders // [THEN] Field values are correctly substituted into the text expression - LibraryAssert.AreEqual('Turkey A is 1234 B', QltyExpressionMgmt.EvaluateTextExpression('Turkey [Source Custom 1] is [Source Quantity (Base)] [Source Item No.]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'Basic text replacement with names'); + LibraryAssert.AreEqual('Turkey A is 1234 B', QltyInspectionUtility.EvaluateTextExpression('Turkey [Source Custom 1] is [Source Quantity (Base)] [Source Item No.]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'Basic text replacement with names'); // [THEN] Non-existent field names in the expression are not replaced - LibraryAssert.AreEqual('Turkey A is [Quantity (Base)] [Item No.]', QltyExpressionMgmt.EvaluateTextExpression('Turkey [Source Custom 1] is [Quantity (Base)] [Item No.]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'Basic text replacement from caption will not work.'); + LibraryAssert.AreEqual('Turkey A is [Quantity (Base)] [Item No.]', QltyInspectionUtility.EvaluateTextExpression('Turkey [Source Custom 1] is [Quantity (Base)] [Item No.]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'Basic text replacement from caption will not work.'); end; [Test] @@ -64,7 +63,6 @@ codeunit 139961 "Qlty. Tests - Expressions" Item: Record Item; TempIgnoredQltyInspectionHeader: Record "Qlty. Inspection Header" temporary; TempIgnoredQltyInspectionLine: Record "Qlty. Inspection Line" temporary; - QltyExpressionMgmt: Codeunit "Qlty. Expression Mgmt."; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; begin // [SCENARIO] Validate text expression evaluation with item record field lookup @@ -86,7 +84,7 @@ codeunit 139961 "Qlty. Tests - Expressions" // [WHEN] Text expression is evaluated with item field lookup syntax // [THEN] Item field values are correctly retrieved and substituted into the expression LibraryAssert.AreEqual('A turkey apple cheese is 123' + GetRegionalDecimalSeparator() + '45', - QltyExpressionMgmt.EvaluateTextExpression('A [Item:Description 2] is [Item:Unit Cost]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), + QltyInspectionUtility.EvaluateTextExpression('A [Item:Description 2] is [Item:Unit Cost]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'Basic item lookup a'); end; @@ -96,7 +94,6 @@ codeunit 139961 "Qlty. Tests - Expressions" Item: Record Item; TempIgnoredQltyInspectionHeader: Record "Qlty. Inspection Header" temporary; TempIgnoredQltyInspectionLine: Record "Qlty. Inspection Line" temporary; - QltyExpressionMgmt: Codeunit "Qlty. Expression Mgmt."; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; begin // [SCENARIO] Validate text expression evaluation with different formatting options for item field lookups @@ -118,25 +115,25 @@ codeunit 139961 "Qlty. Tests - Expressions" // [WHEN] Text expression is evaluated with F0 format (standard with thousands separator) // [THEN] The value is formatted with thousands separators and decimal separator LibraryAssert.AreEqual('F0 A turkey apple cheese is 1' + GetRegionalThousandsSeparator() + '234' + GetRegionalThousandsSeparator() + '567' + GetRegionalThousandsSeparator() + '890' + GetRegionalDecimalSeparator() + '12', - QltyExpressionMgmt.EvaluateTextExpression('F0 A [Item:Description 2] is [Item(F0):Unit Cost]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), + QltyInspectionUtility.EvaluateTextExpression('F0 A [Item:Description 2] is [Item(F0):Unit Cost]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'Table(F0):field'); // [WHEN] Text expression is evaluated with F1 format (no thousands separator) // [THEN] The value is formatted without thousands separators LibraryAssert.AreEqual('F1 A turkey apple cheese is 1234567890' + GetRegionalDecimalSeparator() + '12', - QltyExpressionMgmt.EvaluateTextExpression('F1 A [Item:Description 2] is [Item(F1):Unit Cost]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), + QltyInspectionUtility.EvaluateTextExpression('F1 A [Item:Description 2] is [Item(F1):Unit Cost]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'Table(F1):field'); // [WHEN] Text expression is evaluated with F2 format (plain format) // [THEN] The value is formatted as a plain decimal number - LibraryAssert.AreEqual('F2 A turkey apple cheese is 1234567890.12', QltyExpressionMgmt.EvaluateTextExpression('F2 A [Item:Description 2] is [Item(F2):Unit Cost]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), + LibraryAssert.AreEqual('F2 A turkey apple cheese is 1234567890.12', QltyInspectionUtility.EvaluateTextExpression('F2 A [Item:Description 2] is [Item(F2):Unit Cost]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'Table(F2):field'); // [WHEN] Text expression is evaluated with F9 format (same as F2, plain format) // [THEN] The value is formatted as a plain decimal number - LibraryAssert.AreEqual('F9 A turkey apple cheese is 1234567890.12', QltyExpressionMgmt.EvaluateTextExpression('F9 A [Item:Description 2] is [Item(F9):Unit Cost]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), + LibraryAssert.AreEqual('F9 A turkey apple cheese is 1234567890.12', QltyInspectionUtility.EvaluateTextExpression('F9 A [Item:Description 2] is [Item(F9):Unit Cost]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'Table(F9):field'); // [WHEN] Text expression is evaluated with legacy format syntax (ItemF) // [THEN] The legacy syntax still works with standard formatting LibraryAssert.AreEqual('(legacy format syntax) A turkey apple cheese is 1' + GetRegionalThousandsSeparator() + '234' + GetRegionalThousandsSeparator() + '567' + GetRegionalThousandsSeparator() + '890' + GetRegionalDecimalSeparator() + '12', - QltyExpressionMgmt.EvaluateTextExpression('(legacy format syntax) A [Item:Description 2] is [ItemF:Unit Cost]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), + QltyInspectionUtility.EvaluateTextExpression('(legacy format syntax) A [Item:Description 2] is [ItemF:Unit Cost]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'TableF:field'); end; @@ -146,7 +143,6 @@ codeunit 139961 "Qlty. Tests - Expressions" Item: Record Item; TempIgnoredQltyInspectionHeader: Record "Qlty. Inspection Header" temporary; TempIgnoredQltyInspectionLine: Record "Qlty. Inspection Line" temporary; - QltyExpressionMgmt: Codeunit "Qlty. Expression Mgmt."; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; begin // [SCENARIO] Validate the FORMATNUM function for formatting numeric values in text expressions @@ -168,20 +164,20 @@ codeunit 139961 "Qlty. Tests - Expressions" // [WHEN] FORMATNUM function is used with format 0 (standard with thousands separator) // [THEN] The value is formatted with thousands separators LibraryAssert.AreEqual('F0 A turkey apple cheese is 1' + GetRegionalThousandsSeparator() + '234' + GetRegionalThousandsSeparator() + '567' + GetRegionalThousandsSeparator() + '890' + GetRegionalDecimalSeparator() + '12', - QltyExpressionMgmt.EvaluateTextExpression('F0 A [Item:Description 2] is [FORMATNUM([Item:Unit Cost];0;)]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), + QltyInspectionUtility.EvaluateTextExpression('F0 A [Item:Description 2] is [FORMATNUM([Item:Unit Cost];0;)]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'FORMATNUM-0'); // [WHEN] FORMATNUM function is used with format 1 (no thousands separator) // [THEN] The value is formatted without thousands separators LibraryAssert.AreEqual('F1 A turkey apple cheese is 1234567890' + GetRegionalDecimalSeparator() + '12', - QltyExpressionMgmt.EvaluateTextExpression('F1 A [Item:Description 2] is [FORMATNUM([Item:Unit Cost];1;)]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), + QltyInspectionUtility.EvaluateTextExpression('F1 A [Item:Description 2] is [FORMATNUM([Item:Unit Cost];1;)]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'FORMATNUM-1'); // [WHEN] FORMATNUM function is used with format 2 (plain format) // [THEN] The value is formatted as a plain decimal number - LibraryAssert.AreEqual('F2 A turkey apple cheese is 1234567890.12', QltyExpressionMgmt.EvaluateTextExpression('F2 A [Item:Description 2] is [FORMATNUM([Item:Unit Cost];2; )]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), + LibraryAssert.AreEqual('F2 A turkey apple cheese is 1234567890.12', QltyInspectionUtility.EvaluateTextExpression('F2 A [Item:Description 2] is [FORMATNUM([Item:Unit Cost];2; )]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'FORMATNUM-2'); // [WHEN] FORMATNUM function is used with format 9 (same as format 2) // [THEN] The value is formatted as a plain decimal number - LibraryAssert.AreEqual('F9 A turkey apple cheese is 1234567890.12', QltyExpressionMgmt.EvaluateTextExpression('F9 A [Item:Description 2] is [FORMATNUM([Item:Unit Cost];9; )]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), + LibraryAssert.AreEqual('F9 A turkey apple cheese is 1234567890.12', QltyInspectionUtility.EvaluateTextExpression('F9 A [Item:Description 2] is [FORMATNUM([Item:Unit Cost];9; )]', TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'FORMATNUM-9'); end; @@ -191,7 +187,6 @@ codeunit 139961 "Qlty. Tests - Expressions" Location: Record Location; TempIgnoredQltyInspectionHeader: Record "Qlty. Inspection Header" temporary; TempIgnoredQltyInspectionLine: Record "Qlty. Inspection Line" temporary; - QltyExpressionMgmt: Codeunit "Qlty. Expression Mgmt."; LibraryWarehouse: Codeunit "Library - Warehouse"; begin // [SCENARIO] Validate the LOOKUP function for retrieving field values based on another field's value @@ -203,55 +198,47 @@ codeunit 139961 "Qlty. Tests - Expressions" // [WHEN] LOOKUP expression is evaluated to find location code by name // [THEN] The correct location code is returned - LibraryAssert.AreEqual(Location.Code, QltyExpressionMgmt.EvaluateTextExpression(StrSubstNo(LookupExpressionTok, LocationNameTok), TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'should return the location code'); + LibraryAssert.AreEqual(Location.Code, QltyInspectionUtility.EvaluateTextExpression(StrSubstNo(LookupExpressionTok, LocationNameTok), TempIgnoredQltyInspectionHeader, TempIgnoredQltyInspectionLine), 'should return the location code'); end; [Test] procedure EvaluateFirstStringOnlyFunctions_Replace() - var - QltyExpressionMgmt: Codeunit "Qlty. Expression Mgmt."; begin // [SCENARIO] Validate the REPLACE function in text expressions // [WHEN] REPLACE function is evaluated to replace 'apple' with 'banana' // [THEN] The text is correctly replaced - LibraryAssert.AreEqual('banana', QltyExpressionMgmt.TestEvaluateSpecialStringFunctions('[REPLACE(apple;apple;banana)]'), 'should return the replaced text'); + LibraryAssert.AreEqual('banana', QltyInspectionUtility.TestEvaluateSpecialStringFunctions('[REPLACE(apple;apple;banana)]'), 'should return the replaced text'); end; [Test] procedure EvaluateFirstStringOnlyFunctions_Copystr() - var - QltyExpressionMgmt: Codeunit "Qlty. Expression Mgmt."; begin // [SCENARIO] Validate the COPYSTR function in text expressions // [WHEN] COPYSTR function is evaluated to extract substring from position 5, length 3 // [THEN] The substring 'cat' is correctly extracted - LibraryAssert.AreEqual('cat', QltyExpressionMgmt.TestEvaluateSpecialStringFunctions('[COPYSTR(copycat;5;3)]'), 'should return the replaced text'); + LibraryAssert.AreEqual('cat', QltyInspectionUtility.TestEvaluateSpecialStringFunctions('[COPYSTR(copycat;5;3)]'), 'should return the replaced text'); end; [Test] procedure EvaluateFirstStringOnlyFunctions_Classify_True() - var - QltyExpressionMgmt: Codeunit "Qlty. Expression Mgmt."; begin // [SCENARIO] Validate the CLASSIFY function when condition matches // [WHEN] CLASSIFY function is evaluated with matching condition ('cat' equals 'cat') // [THEN] The true value is returned - LibraryAssert.AreEqual('true', QltyExpressionMgmt.TestEvaluateSpecialStringFunctions('[CLASSIFY(cat;cat;true)]'), 'should return the classify value'); + LibraryAssert.AreEqual('true', QltyInspectionUtility.TestEvaluateSpecialStringFunctions('[CLASSIFY(cat;cat;true)]'), 'should return the classify value'); end; [Test] procedure EvaluateFirstStringOnlyFunctions_Classify_False() - var - QltyExpressionMgmt: Codeunit "Qlty. Expression Mgmt."; begin // [SCENARIO] Validate the CLASSIFY function when condition does not match // [WHEN] CLASSIFY function is evaluated with non-matching condition ('copycat' does not equal 'cat') // [THEN] An empty string is returned - LibraryAssert.AreEqual('', QltyExpressionMgmt.TestEvaluateSpecialStringFunctions('[CLASSIFY(copycat;cat;true)]'), 'should return the classify value'); + LibraryAssert.AreEqual('', QltyInspectionUtility.TestEvaluateSpecialStringFunctions('[CLASSIFY(copycat;cat;true)]'), 'should return the classify value'); end; [Test] @@ -260,8 +247,6 @@ codeunit 139961 "Qlty. Tests - Expressions" QltyInspectionHeader: Record "Qlty. Inspection Header"; QltyInspectionTemplateHdr: Record "Qlty. Inspection Template Hdr."; QltyInspectionGenRule: Record "Qlty. Inspection Gen. Rule"; - QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; - QltyExpressionMgmt: Codeunit "Qlty. Expression Mgmt."; begin // [SCENARIO] Validate that expression evaluation for records is case-insensitive @@ -273,15 +258,15 @@ codeunit 139961 "Qlty. Tests - Expressions" // [WHEN] Expression is evaluated with lowercase field name // [THEN] The template code is correctly retrieved - LibraryAssert.AreEqual(QltyInspectionHeader."Template Code", QltyExpressionMgmt.EvaluateExpressionForRecord(TemplateTok, QltyInspectionHeader, true), 'Should find template code'); + LibraryAssert.AreEqual(QltyInspectionHeader."Template Code", QltyInspectionUtility.EvaluateExpressionForRecord(TemplateTok, QltyInspectionHeader, true), 'Should find template code'); // [WHEN] Expression is evaluated with capitalized field name // [THEN] The template code is correctly retrieved (case-insensitive) - LibraryAssert.AreEqual(QltyInspectionHeader."Template Code", QltyExpressionMgmt.EvaluateExpressionForRecord(TemplateCapitalizedTok, QltyInspectionHeader, true), 'Should find template code'); + LibraryAssert.AreEqual(QltyInspectionHeader."Template Code", QltyInspectionUtility.EvaluateExpressionForRecord(TemplateCapitalizedTok, QltyInspectionHeader, true), 'Should find template code'); // [WHEN] Expression is evaluated with uppercase field name // [THEN] The template code is correctly retrieved (case-insensitive) - LibraryAssert.AreEqual(QltyInspectionHeader."Template Code", QltyExpressionMgmt.EvaluateExpressionForRecord(TemplateUppercaseTok, QltyInspectionHeader, true), 'Should find template code'); + LibraryAssert.AreEqual(QltyInspectionHeader."Template Code", QltyInspectionUtility.EvaluateExpressionForRecord(TemplateUppercaseTok, QltyInspectionHeader, true), 'Should find template code'); QltyInspectionGenRule.SetRange("Template Code", QltyInspectionTemplateHdr."Code"); QltyInspectionGenRule.DeleteAll(); diff --git a/src/Apps/W1/Quality Management/test/src/QltyTestsItemTracking.Codeunit.al b/src/Apps/W1/Quality Management/test/src/QltyTestsItemTracking.Codeunit.al index 729fe16c75..55ddda8675 100644 --- a/src/Apps/W1/Quality Management/test/src/QltyTestsItemTracking.Codeunit.al +++ b/src/Apps/W1/Quality Management/test/src/QltyTestsItemTracking.Codeunit.al @@ -42,7 +42,6 @@ codeunit 139971 "Qlty. Tests - Item Tracking" var LibraryAssert: Codeunit "Library Assert"; QltyItemTrackingMgmt: Codeunit "Qlty. Item Tracking Mgmt."; - QltyItemTracking: Codeunit "Qlty. Item Tracking"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; LibraryUtility: Codeunit "Library - Utility"; LibraryInventory: Codeunit "Library - Inventory"; @@ -2741,7 +2740,7 @@ codeunit 139971 "Qlty. Tests - Item Tracking" TempQltyInspectionHeader."Source Lot No." := LotNo; // [WHEN] Setting lot block state to blocked - QltyItemTracking.SetLotBlockState(TempQltyInspectionHeader, true); + QltyInspectionUtility.SetLotBlockState(TempQltyInspectionHeader, true); // [THEN] Lot number information shows lot is blocked LotNoInformation.Get(Item."No.", '', LotNo); @@ -2778,7 +2777,7 @@ codeunit 139971 "Qlty. Tests - Item Tracking" LotNoInformation.Modify(); // [WHEN] Setting lot block state to unblocked - QltyItemTracking.SetLotBlockState(TempQltyInspectionHeader, false); + QltyInspectionUtility.SetLotBlockState(TempQltyInspectionHeader, false); // [THEN] Lot number information shows lot is not blocked LotNoInformation.Get(Item."No.", '', LotNo); @@ -2807,7 +2806,7 @@ codeunit 139971 "Qlty. Tests - Item Tracking" TempQltyInspectionHeader."Source Serial No." := SerialNo; // [WHEN] Setting serial block state to blocked - QltyItemTracking.SetSerialBlockState(TempQltyInspectionHeader, true); + QltyInspectionUtility.SetSerialBlockState(TempQltyInspectionHeader, true); // [THEN] Serial number information shows serial is blocked SerialNoInformation.Get(Item."No.", '', SerialNo); @@ -2844,7 +2843,7 @@ codeunit 139971 "Qlty. Tests - Item Tracking" SerialNoInformation.Modify(); // [WHEN] Setting serial block state to unblocked - QltyItemTracking.SetSerialBlockState(TempQltyInspectionHeader, false); + QltyInspectionUtility.SetSerialBlockState(TempQltyInspectionHeader, false); // [THEN] Serial number information shows serial is not blocked SerialNoInformation.Get(Item."No.", '', SerialNo); @@ -2873,7 +2872,7 @@ codeunit 139971 "Qlty. Tests - Item Tracking" TempQltyInspectionHeader."Source Package No." := PackageNo; // [WHEN] Setting package block state to blocked - QltyItemTracking.SetPackageBlockState(TempQltyInspectionHeader, true); + QltyInspectionUtility.SetPackageBlockState(TempQltyInspectionHeader, true); // [THEN] Package number information shows package is blocked PackageNoInformation.Get(Item."No.", '', PackageNo); @@ -2910,7 +2909,7 @@ codeunit 139971 "Qlty. Tests - Item Tracking" PackageNoInformation.Modify(); // [WHEN] Setting package block state to unblocked - QltyItemTracking.SetPackageBlockState(TempQltyInspectionHeader, false); + QltyInspectionUtility.SetPackageBlockState(TempQltyInspectionHeader, false); // [THEN] Package number information shows package is not blocked PackageNoInformation.Get(Item."No.", '', PackageNo); diff --git a/src/Apps/W1/Quality Management/test/src/QltyTestsResultEval.Codeunit.al b/src/Apps/W1/Quality Management/test/src/QltyTestsResultEval.Codeunit.al index a9be3c13fe..bb449a8702 100644 --- a/src/Apps/W1/Quality Management/test/src/QltyTestsResultEval.Codeunit.al +++ b/src/Apps/W1/Quality Management/test/src/QltyTestsResultEval.Codeunit.al @@ -175,27 +175,27 @@ codeunit 139963 "Qlty. Tests - Result Eval." [TryFunction] procedure Try_TestValueDateIntentionallyBad() var - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; + QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; TestValue: Text[250]; begin TestValue := 'not a date'; - LibraryAssert.IsFalse(QltyResultEvaluation.CheckIfValueIsDate(TestValue, '', false), 'Date basic not a date 1'); + LibraryAssert.IsFalse(QltyInspectionUtility.CheckIfValueIsDate(TestValue, '', false), 'Date basic not a date 1'); end; [TryFunction] procedure Try_TestValueDateTimeIntentionallyBad() var - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; + QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; TestValue: Text[250]; begin TestValue := 'not a datetime'; - LibraryAssert.IsFalse(QltyResultEvaluation.CheckIfValueIsDateTime(TestValue, '', false), 'Datetime basic not a date time 1'); + LibraryAssert.IsFalse(QltyInspectionUtility.CheckIfValueIsDateTime(TestValue, '', false), 'Datetime basic not a date time 1'); end; [Test] procedure ValueDate() var - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; + QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; TestValue: Text[250]; Date: Date; PredictableDate: Date; @@ -221,7 +221,7 @@ codeunit 139963 "Qlty. Tests - Result Eval." Date := DMY2Date(28, 1, Year); OriginalTestValue := TestValue; - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDate(TestValue, '', false), + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDate(TestValue, '', false), 'Date basic no condition 2'); if IsDayMonthYearLocal() then LibraryAssert.AreNotEqual(TestValue, format(Date, 0, '' + GetDateSeparator() + '' + GetDateSeparator() + ''), 'Back and forth date - no change') @@ -229,47 +229,47 @@ codeunit 139963 "Qlty. Tests - Result Eval." LibraryAssert.AreNotEqual(TestValue, format(Date, 0, '' + GetDateSeparator() + '' + GetDateSeparator() + ''), 'Back and forth date - no change'); TestValue := OriginalTestValue; - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDate(TestValue, '', true), 'Date basic no condition 1'); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDate(TestValue, '', true), 'Date basic no condition 1'); LibraryAssert.AreEqual(TestValue, format(Date, 0, '--'), 'Back and forth date - should change'); - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDate(TestValue, '1' + GetDateSeparator() + '1..2' + GetDateSeparator() + '2', false), 'Date basic date range 1'); - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDate(TestValue, StrSubstNo('1' + GetDateSeparator() + '1' + GetDateSeparator() + '%1..2' + GetDateSeparator() + '2' + GetDateSeparator() + '%1', YearAsString), false), 'Date basic date range 2'); - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDate(TestValue, StrSubstNo('>1' + GetDateSeparator() + '1' + GetDateSeparator() + '%1', YearAsString), false), 'Date basic date range 3'); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDate(TestValue, '1' + GetDateSeparator() + '1..2' + GetDateSeparator() + '2', false), 'Date basic date range 1'); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDate(TestValue, StrSubstNo('1' + GetDateSeparator() + '1' + GetDateSeparator() + '%1..2' + GetDateSeparator() + '2' + GetDateSeparator() + '%1', YearAsString), false), 'Date basic date range 2'); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDate(TestValue, StrSubstNo('>1' + GetDateSeparator() + '1' + GetDateSeparator() + '%1', YearAsString), false), 'Date basic date range 3'); - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDate(TestValue, StrSubstNo('<=%1', format(Date)), false), 'Date basic date range 4'); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDate(TestValue, StrSubstNo('<=%1', format(Date)), false), 'Date basic date range 4'); if IsDayMonthYearLocal() then begin - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDate(TestValue, '28' + GetDateSeparator() + '1', false), + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDate(TestValue, '28' + GetDateSeparator() + '1', false), 'Date basic NO CONVERT'); LibraryAssert.AreNotEqual('28-1' + YearAsString, TestValue, 'date basic NO CONVERT'); - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDate(TestValue, '28-1', true), 'Date basic convert'); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDate(TestValue, '28-1', true), 'Date basic convert'); end else begin - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDate(TestValue, '1' + GetDateSeparator() + '28', false), 'Date basic NO CONVERT'); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDate(TestValue, '1' + GetDateSeparator() + '28', false), 'Date basic NO CONVERT'); LibraryAssert.AreNotEqual('1/28/' + YearAsString, TestValue, 'date basic NO CONVERT'); - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDate(TestValue, '1/28', true), 'Date basic convert'); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDate(TestValue, '1/28', true), 'Date basic convert'); end; LibraryAssert.AreEqual(YearAsString + '-01-28', TestValue, 'date basic convert 1'); TestValue := '2023-12-31'; Date := DMY2Date(31, 12, 2023); - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDate(TestValue, '', true), 'Date universal date value'); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDate(TestValue, '', true), 'Date universal date value'); TestValue := format(PredictableDate, 0, 9); - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDate(TestValue, TestValue, true), 'expected value matches expected date.'); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDate(TestValue, TestValue, true), 'expected value matches expected date.'); TestValue := format(PredictableDate, 0, 9); - LibraryAssert.IsFalse(QltyResultEvaluation.CheckIfValueIsDate(TestValue, '<>' + TestValue, true), 'expected value matches anything but the expected date.'); + LibraryAssert.IsFalse(QltyInspectionUtility.CheckIfValueIsDate(TestValue, '<>' + TestValue, true), 'expected value matches anything but the expected date.'); TestValue := ''; - LibraryAssert.IsFalse(QltyResultEvaluation.CheckIfValueIsDate(TestValue, format(PredictableDate, 0, 9), true), 'blank input date with valid acceptable date'); + LibraryAssert.IsFalse(QltyInspectionUtility.CheckIfValueIsDate(TestValue, format(PredictableDate, 0, 9), true), 'blank input date with valid acceptable date'); end; [Test] procedure ValueDateTime() var - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; + QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; TypeHelper: Codeunit "Type Helper"; TimezoneOffset: Duration; TestValue: Text[250]; @@ -294,47 +294,47 @@ codeunit 139963 "Qlty. Tests - Result Eval." TestValue := format(Date, 0, 9); OriginalTestValue := TestValue; // [THEN] Datetime passes validation and value remains unchanged - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDateTime(TestValue, '', false), 'Datetime basic do not adjust' + DateFailureSuffixDetails); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDateTime(TestValue, '', false), 'Datetime basic do not adjust' + DateFailureSuffixDetails); LibraryAssert.AreEqual(OriginalTestValue, TestValue, 'test value should not have changed for datetime ' + DateFailureSuffixDetails); // [WHEN] Testing datetime with timezone adjustment TestValue := OriginalTestValue; // [THEN] Datetime passes validation and converts correctly - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDateTime(TestValue, '', true), 'Date basic with adjustment of datetime' + DateFailureSuffixDetails); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDateTime(TestValue, '', true), 'Date basic with adjustment of datetime' + DateFailureSuffixDetails); LibraryAssert.AreEqual(TestValue, format(Date, 0, 9), 'back and forth datetime.' + DateFailureSuffixDetails); // [WHEN] Testing datetime within valid date range without adjustment // [THEN] Datetime within range passes validation - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDateTime(TestValue, StrSubstNo('%1..%2', CreateDateTime(DMY2Date(28, 1, 2004), 000000T), + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDateTime(TestValue, StrSubstNo('%1..%2', CreateDateTime(DMY2Date(28, 1, 2004), 000000T), CreateDateTime(DMY2Date(28, 1, 2004), 235900T)), false), 'Datetime basic date range jan to feb no adjustment ' + DateFailureSuffixDetails); // [WHEN] Testing datetime outside valid date range // [THEN] Datetime outside range fails validation - LibraryAssert.IsFalse(QltyResultEvaluation.CheckIfValueIsDateTime(TestValue, StrSubstNo('%1..%2', CreateDateTime(DMY2Date(28, 2, 2004), 000000T), + LibraryAssert.IsFalse(QltyInspectionUtility.CheckIfValueIsDateTime(TestValue, StrSubstNo('%1..%2', CreateDateTime(DMY2Date(28, 2, 2004), 000000T), CreateDateTime(DMY2Date(28, 3, 2004), 235900T)), false), 'Datetime outside of date range basic date range jan to feb' + DateFailureSuffixDetails); // [WHEN] Testing datetime within valid date range with adjustment // [THEN] Datetime passes validation with timezone adjustment - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDateTime(TestValue, StrSubstNo('%1..%2', CreateDateTime(DMY2Date(28, 1, 2004), 000000T), + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDateTime(TestValue, StrSubstNo('%1..%2', CreateDateTime(DMY2Date(28, 1, 2004), 000000T), CreateDateTime(DMY2Date(28, 1, 2004), 235900T)), true), 'Datetime basic date range jan to feb with adjustment ' + DateFailureSuffixDetails); // [WHEN] Testing exact datetime match TestValue := format(Date, 0, 9); // [THEN] Exact match passes validation - LibraryAssert.IsTrue(QltyResultEvaluation.CheckIfValueIsDateTime(TestValue, TestValue, true), 'expected value matches expected date.' + DateFailureSuffixDetails); + LibraryAssert.IsTrue(QltyInspectionUtility.CheckIfValueIsDateTime(TestValue, TestValue, true), 'expected value matches expected date.' + DateFailureSuffixDetails); // [WHEN] Testing datetime with not-equal condition TestValue := format(Date, 0, 9); // [THEN] Not-equal condition fails when values match - LibraryAssert.IsFalse(QltyResultEvaluation.CheckIfValueIsDateTime(TestValue, '<>' + TestValue, true), 'expected value matches anything but the expected date.' + DateFailureSuffixDetails); + LibraryAssert.IsFalse(QltyInspectionUtility.CheckIfValueIsDateTime(TestValue, '<>' + TestValue, true), 'expected value matches anything but the expected date.' + DateFailureSuffixDetails); // [WHEN] Testing blank datetime against valid acceptable date TestValue := ''; // [THEN] Blank datetime fails validation - LibraryAssert.IsFalse(QltyResultEvaluation.CheckIfValueIsDateTime(TestValue, format(Date, 0, 9), true), 'blank input date with valid acceptable date' + DateFailureSuffixDetails); + LibraryAssert.IsFalse(QltyInspectionUtility.CheckIfValueIsDateTime(TestValue, format(Date, 0, 9), true), 'blank input date with valid acceptable date' + DateFailureSuffixDetails); end; [Test] @@ -351,7 +351,6 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionLine: Record "Qlty. Inspection Line"; QltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; QltyInspectionCreate: Codeunit "Qlty. Inspection - Create"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; OrdersList: List of [Code[20]]; @@ -421,35 +420,35 @@ codeunit 139963 "Qlty. Tests - Result Eval." // [THEN] Result is INPROGRESS for blank value LibraryAssert.AreEqual( 'INPROGRESS', - QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '', NumericalMeasureQltyTest."Case Sensitive"), + QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '', NumericalMeasureQltyTest."Case Sensitive"), 'blank value'); // [THEN] Value at minimum of range (6) evaluates to PASS - LibraryAssert.AreEqual('PASS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '6', NumericalMeasureQltyTest."Case Sensitive"), + LibraryAssert.AreEqual('PASS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '6', NumericalMeasureQltyTest."Case Sensitive"), 'min value inspection line result'); // [THEN] Value slightly exceeding maximum (7.0001) evaluates to FAIL - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '7.0001', NumericalMeasureQltyTest."Case Sensitive"), + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '7.0001', NumericalMeasureQltyTest."Case Sensitive"), 'slightly exceeding max inspection line result'); // [THEN] Value slightly below minimum (5.999999) evaluates to FAIL LibraryAssert.AreEqual( 'FAIL', - QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '5.999999', NumericalMeasureQltyTest."Case Sensitive"), + QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '5.999999', NumericalMeasureQltyTest."Case Sensitive"), 'slightly before min inspection line result'); // [THEN] Value slightly below maximum (6.999999) evaluates to PASS LibraryAssert.AreEqual( 'PASS', - QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '6.999999', NumericalMeasureQltyTest."Case Sensitive"), + QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '6.999999', NumericalMeasureQltyTest."Case Sensitive"), 'slightly before min inspection line result'); // [THEN] Blank value is not treated as zero and evaluates to INPROGRESS LibraryAssert.AreEqual( 'INPROGRESS', - QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '', NumericalMeasureQltyTest."Case Sensitive"), + QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '', NumericalMeasureQltyTest."Case Sensitive"), 'ensure that blank is not treated as a zero - decimal.'); // [THEN] Zero value is not treated as blank and evaluates to FAIL - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '0.0', NumericalMeasureQltyTest."Case Sensitive"), + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '0.0', NumericalMeasureQltyTest."Case Sensitive"), 'ensure that zero is not treated as a blank - decimal'); end; @@ -467,7 +466,6 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionLine: Record "Qlty. Inspection Line"; QltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; QltyInspectionCreate: Codeunit "Qlty. Inspection - Create"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; OrdersList: List of [Code[20]]; @@ -531,14 +529,14 @@ codeunit 139963 "Qlty. Tests - Result Eval." // [WHEN] Result is evaluated with blank value // [THEN] Result is INPROGRESS for blank value - LibraryAssert.AreEqual('INPROGRESS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateTimeQltyTest."Test Value Type", '', DateTimeQltyTest."Case Sensitive"), 'blank value'); + LibraryAssert.AreEqual('INPROGRESS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateTimeQltyTest."Test Value Type", '', DateTimeQltyTest."Case Sensitive"), 'blank value'); // [THEN] Exact datetime match evaluates to PASS - LibraryAssert.AreEqual('PASS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateTimeQltyTest."Test Value Type", '2004-05-06 01:02:03', DateTimeQltyTest."Case Sensitive"), 'exact value pass'); + LibraryAssert.AreEqual('PASS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateTimeQltyTest."Test Value Type", '2004-05-06 01:02:03', DateTimeQltyTest."Case Sensitive"), 'exact value pass'); // [THEN] Datetime one second past expected evaluates to FAIL - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateTimeQltyTest."Test Value Type", '2004-05-06 01:02:04', DateTimeQltyTest."Case Sensitive"), 'slightly exceeding max inspection line result'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateTimeQltyTest."Test Value Type", '2004-05-06 01:02:04', DateTimeQltyTest."Case Sensitive"), 'slightly exceeding max inspection line result'); // [THEN] Field-level condition datetime is ignored (FAIL not PASS) - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateTimeQltyTest."Test Value Type", '2001-02-03 01:02:03', DateTimeQltyTest."Case Sensitive"), 'should have ignored the default field pass condition.'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateTimeQltyTest."Test Value Type", '2001-02-03 01:02:03', DateTimeQltyTest."Case Sensitive"), 'should have ignored the default field pass condition.'); end; [Test] @@ -555,7 +553,6 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionLine: Record "Qlty. Inspection Line"; QltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; QltyInspectionCreate: Codeunit "Qlty. Inspection - Create"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; OrdersList: List of [Code[20]]; @@ -618,14 +615,14 @@ codeunit 139963 "Qlty. Tests - Result Eval." // [WHEN] Result is evaluated with blank value // [THEN] Result is INPROGRESS for blank value - LibraryAssert.AreEqual('INPROGRESS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateQltyTest."Test Value Type", '', DateQltyTest."Case Sensitive"), 'blank value'); + LibraryAssert.AreEqual('INPROGRESS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateQltyTest."Test Value Type", '', DateQltyTest."Case Sensitive"), 'blank value'); // [THEN] Exact date match evaluates to PASS - LibraryAssert.AreEqual('PASS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateQltyTest."Test Value Type", '2004-05-06', DateQltyTest."Case Sensitive"), 'exact value pass'); + LibraryAssert.AreEqual('PASS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateQltyTest."Test Value Type", '2004-05-06', DateQltyTest."Case Sensitive"), 'exact value pass'); // [THEN] Date one day past expected evaluates to FAIL - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateQltyTest."Test Value Type", '2004-05-07', DateQltyTest."Case Sensitive"), 'slightly exceeding max inspection line result'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateQltyTest."Test Value Type", '2004-05-07', DateQltyTest."Case Sensitive"), 'slightly exceeding max inspection line result'); // [THEN] Field-level condition date is ignored (FAIL not PASS) - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateQltyTest."Test Value Type", '2001-02-03', DateQltyTest."Case Sensitive"), 'should have ignored the default field pass condition.'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, DateQltyTest."Test Value Type", '2001-02-03', DateQltyTest."Case Sensitive"), 'should have ignored the default field pass condition.'); end; [Test] @@ -642,7 +639,6 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionLine: Record "Qlty. Inspection Line"; QltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; QltyInspectionCreate: Codeunit "Qlty. Inspection - Create"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; OrdersList: List of [Code[20]]; @@ -701,17 +697,17 @@ codeunit 139963 "Qlty. Tests - Result Eval." // [WHEN] Result is evaluated with blank value // [THEN] Result is INPROGRESS for blank value - LibraryAssert.AreEqual('INPROGRESS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, BooleanQltyTest."Test Value Type", '', BooleanQltyTest."Case Sensitive"), 'blank value'); + LibraryAssert.AreEqual('INPROGRESS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, BooleanQltyTest."Test Value Type", '', BooleanQltyTest."Case Sensitive"), 'blank value'); // [THEN] Value 'Yes' evaluates to PASS - LibraryAssert.AreEqual('PASS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, BooleanQltyTest."Test Value Type", 'Yes', BooleanQltyTest."Case Sensitive"), 'exact value pass'); + LibraryAssert.AreEqual('PASS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, BooleanQltyTest."Test Value Type", 'Yes', BooleanQltyTest."Case Sensitive"), 'exact value pass'); // [THEN] Value 'On' (alternative true value) evaluates to PASS - LibraryAssert.AreEqual('PASS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, BooleanQltyTest."Test Value Type", 'On', BooleanQltyTest."Case Sensitive"), 'different kind of yes'); + LibraryAssert.AreEqual('PASS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, BooleanQltyTest."Test Value Type", 'On', BooleanQltyTest."Case Sensitive"), 'different kind of yes'); // [THEN] Value 'No' evaluates to FAIL - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, BooleanQltyTest."Test Value Type", 'No', BooleanQltyTest."Case Sensitive"), 'Direct No.'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, BooleanQltyTest."Test Value Type", 'No', BooleanQltyTest."Case Sensitive"), 'Direct No.'); // [THEN] Value 'False' (alternative false value) evaluates to FAIL - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, BooleanQltyTest."Test Value Type", 'False', BooleanQltyTest."Case Sensitive"), 'different kind of no.'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, BooleanQltyTest."Test Value Type", 'False', BooleanQltyTest."Case Sensitive"), 'different kind of no.'); // [THEN] Invalid boolean value evaluates to INPROGRESS - LibraryAssert.AreEqual('INPROGRESS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, BooleanQltyTest."Test Value Type", 'this is not a boolean', BooleanQltyTest."Case Sensitive"), 'not a boolean'); + LibraryAssert.AreEqual('INPROGRESS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, BooleanQltyTest."Test Value Type", 'this is not a boolean', BooleanQltyTest."Case Sensitive"), 'not a boolean'); end; [Test] @@ -728,7 +724,6 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionLine: Record "Qlty. Inspection Line"; QltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; QltyInspectionCreate: Codeunit "Qlty. Inspection - Create"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; OrdersList: List of [Code[20]]; @@ -779,10 +774,10 @@ codeunit 139963 "Qlty. Tests - Result Eval." // [WHEN] Result is evaluated with blank value // [THEN] Blank value returns blank result (labels are not resultd) - LibraryAssert.AreEqual('', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, LabelQltyTest."Test Value Type", '', LabelQltyTest."Case Sensitive"), 'blank value should result in a blank result for labels.'); + LibraryAssert.AreEqual('', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, LabelQltyTest."Test Value Type", '', LabelQltyTest."Case Sensitive"), 'blank value should result in a blank result for labels.'); // [THEN] Any value returns blank result (labels are not resultd) - LibraryAssert.AreEqual('', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, LabelQltyTest."Test Value Type", 'anything at all is ignored.', LabelQltyTest."Case Sensitive"), 'with a label, it is always a blank result.'); + LibraryAssert.AreEqual('', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, LabelQltyTest."Test Value Type", 'anything at all is ignored.', LabelQltyTest."Case Sensitive"), 'with a label, it is always a blank result.'); end; [Test] @@ -799,7 +794,6 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionLine: Record "Qlty. Inspection Line"; QltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; QltyInspectionCreate: Codeunit "Qlty. Inspection - Create"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; OrdersList: List of [Code[20]]; @@ -869,25 +863,25 @@ codeunit 139963 "Qlty. Tests - Result Eval." // [WHEN] Result is evaluated with blank value // [THEN] Result is INPROGRESS for blank value - LibraryAssert.AreEqual('INPROGRESS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '', NumericalMeasureQltyTest."Case Sensitive"), 'blank value'); + LibraryAssert.AreEqual('INPROGRESS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '', NumericalMeasureQltyTest."Case Sensitive"), 'blank value'); // [THEN] Value 6 (minimum of range) evaluates to PASS - LibraryAssert.AreEqual('PASS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '6', NumericalMeasureQltyTest."Case Sensitive"), 'min value inspection line result'); + LibraryAssert.AreEqual('PASS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '6', NumericalMeasureQltyTest."Case Sensitive"), 'min value inspection line result'); // [THEN] Value 7 (maximum of range) evaluates to PASS - LibraryAssert.AreEqual('PASS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '7', NumericalMeasureQltyTest."Case Sensitive"), 'max value inspection line result'); + LibraryAssert.AreEqual('PASS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '7', NumericalMeasureQltyTest."Case Sensitive"), 'max value inspection line result'); // [THEN] Value 8 (exceeding maximum) evaluates to FAIL - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '8', NumericalMeasureQltyTest."Case Sensitive"), 'slightly exceeding max inspection line result'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '8', NumericalMeasureQltyTest."Case Sensitive"), 'slightly exceeding max inspection line result'); // [THEN] Value 5 (below minimum) evaluates to FAIL - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '5', NumericalMeasureQltyTest."Case Sensitive"), 'slightly before min inspection line result'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '5', NumericalMeasureQltyTest."Case Sensitive"), 'slightly before min inspection line result'); // [THEN] Value 6 (re-inspection pass value) evaluates to PASS - LibraryAssert.AreEqual('PASS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '6', NumericalMeasureQltyTest."Case Sensitive"), 'pass value.'); + LibraryAssert.AreEqual('PASS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '6', NumericalMeasureQltyTest."Case Sensitive"), 'pass value.'); // [THEN] Blank value is not treated as zero and evaluates to INPROGRESS - LibraryAssert.AreEqual('INPROGRESS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '', NumericalMeasureQltyTest."Case Sensitive"), 'ensure that blank is not treated as a zero - integer.'); + LibraryAssert.AreEqual('INPROGRESS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '', NumericalMeasureQltyTest."Case Sensitive"), 'ensure that blank is not treated as a zero - integer.'); // [THEN] Zero value is not treated as blank and evaluates to FAIL - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '0', NumericalMeasureQltyTest."Case Sensitive"), 'ensure that zero is not treated as a blank - Integer'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '0', NumericalMeasureQltyTest."Case Sensitive"), 'ensure that zero is not treated as a blank - Integer'); // [THEN] Non-integer value (7.0001) causes an error ClearLastError(); - asserterror LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '7.0001', NumericalMeasureQltyTest."Case Sensitive"), 'should error, value is not an integer.'); + asserterror LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, NumericalMeasureQltyTest."Test Value Type", '7.0001', NumericalMeasureQltyTest."Case Sensitive"), 'should error, value is not an integer.'); LibraryAssert.ExpectedError(Expected1Err); end; @@ -906,7 +900,6 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionLine: Record "Qlty. Inspection Line"; QltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; QltyInspectionCreate: Codeunit "Qlty. Inspection - Create"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; OrdersList: List of [Code[20]]; @@ -978,31 +971,31 @@ codeunit 139963 "Qlty. Tests - Result Eval." // [WHEN] Result is evaluated with blank value LibraryAssert.AreEqual(0, SanityCheckQltyInspectionResult.Count(), 'should be no blank results - g'); // [THEN] Result is INPROGRESS for blank value and no blank results created - LibraryAssert.AreEqual('INPROGRESS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", '', TextQltyTest."Case Sensitive"), 'blank value'); + LibraryAssert.AreEqual('INPROGRESS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", '', TextQltyTest."Case Sensitive"), 'blank value'); LibraryAssert.AreEqual(0, SanityCheckQltyInspectionResult.Count(), 'should be no blank results - gb'); // [THEN] Value 'D' (in template condition) evaluates to PASS - LibraryAssert.AreEqual('PASS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'D', TextQltyTest."Case Sensitive"), 'first text-method1'); + LibraryAssert.AreEqual('PASS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'D', TextQltyTest."Case Sensitive"), 'first text-method1'); // [THEN] Value 'D' evaluates to PASS using alternative evaluation method (no line parameter) LibraryAssert.AreEqual('PASS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyIResultConditConf, TextQltyTest."Test Value Type", 'D', TextQltyTest."Case Sensitive"), 'first text method2 test with no line.'); // [THEN] Value 'e' (lowercase) with insensitive comparison evaluates to PASS - LibraryAssert.AreEqual('PASS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'e', TextQltyTest."Case Sensitive"::Insensitive), 'second text lowercase insensitive '); + LibraryAssert.AreEqual('PASS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'e', TextQltyTest."Case Sensitive"::Insensitive), 'second text lowercase insensitive '); if DatabaseIsCaseSensitive then // [THEN] Value 'e' (lowercase) with sensitive comparison evaluates to FAIL - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'e', TextQltyTest."Case Sensitive"::Sensitive), 'second text lowercase sensitive') + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'e', TextQltyTest."Case Sensitive"::Sensitive), 'second text lowercase sensitive') else // [THEN] Value 'e' (lowercase) with sensitive comparison evaluates to PASS - LibraryAssert.AreEqual('PASS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'e', TextQltyTest."Case Sensitive"::Sensitive), 'second text lowercase sensitive'); + LibraryAssert.AreEqual('PASS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'e', TextQltyTest."Case Sensitive"::Sensitive), 'second text lowercase sensitive'); // [THEN] Value 'A' (in field-level condition) evaluates to FAIL (template override works) - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'A', TextQltyTest."Case Sensitive"), 'original field pass, which should be overwritten by the template.'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'A', TextQltyTest."Case Sensitive"), 'original field pass, which should be overwritten by the template.'); // [THEN] Value 'c' (lowercase field-level condition) evaluates to FAIL - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'c', TextQltyTest."Case Sensitive"), 'original field lowercase'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'c', TextQltyTest."Case Sensitive"), 'original field lowercase'); // [THEN] Value 'C' (field-level condition) evaluates to FAIL (template override works) - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'C', TextQltyTest."Case Sensitive"), 'original field'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'C', TextQltyTest."Case Sensitive"), 'original field'); // [THEN] Value 'Monkey' (not in any condition) evaluates to FAIL - LibraryAssert.AreEqual('FAIL', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'Monkey', TextQltyTest."Case Sensitive"), 'A value not in any condition.'); + LibraryAssert.AreEqual('FAIL', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", 'Monkey', TextQltyTest."Case Sensitive"), 'A value not in any condition.'); // [THEN] Blank value re-inspectioned evaluates to INPROGRESS - LibraryAssert.AreEqual('INPROGRESS', QltyResultEvaluation.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", '', TextQltyTest."Case Sensitive"), 'ensure that blank is not treated as a zero - integer.'); + LibraryAssert.AreEqual('INPROGRESS', QltyInspectionUtility.EvaluateResult(QltyInspectionHeader, QltyInspectionLine, QltyIResultConditConf, TextQltyTest."Test Value Type", '', TextQltyTest."Case Sensitive"), 'ensure that blank is not treated as a zero - integer.'); end; [Test] @@ -1021,7 +1014,6 @@ codeunit 139963 "Qlty. Tests - Result Eval." UsesReferenceQltyInspectionLine: Record "Qlty. Inspection Line"; QltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; QltyInspectionCreate: Codeunit "Qlty. Inspection - Create"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; OrdersList: List of [Code[20]]; @@ -1101,7 +1093,7 @@ codeunit 139963 "Qlty. Tests - Result Eval." // [THEN] Result evaluates to PASS LibraryAssert.AreEqual( 'PASS', - QltyResultEvaluation.EvaluateResult( + QltyInspectionUtility.EvaluateResult( QltyInspectionHeader, UsesReferenceQltyInspectionLine, QltyIResultConditConf, @@ -1113,7 +1105,7 @@ codeunit 139963 "Qlty. Tests - Result Eval." // [THEN] Value 1 (at min of dynamic range) evaluates to PASS LibraryAssert.AreEqual( 'PASS', - QltyResultEvaluation.EvaluateResult( + QltyInspectionUtility.EvaluateResult( QltyInspectionHeader, UsesReferenceQltyInspectionLine, QltyIResultConditConf, @@ -1125,7 +1117,7 @@ codeunit 139963 "Qlty. Tests - Result Eval." // [THEN] Value 7 (exceeding dynamic range max) evaluates to FAIL LibraryAssert.AreEqual( 'FAIL', - QltyResultEvaluation.EvaluateResult( + QltyInspectionUtility.EvaluateResult( QltyInspectionHeader, UsesReferenceQltyInspectionLine, QltyIResultConditConf, @@ -1137,7 +1129,7 @@ codeunit 139963 "Qlty. Tests - Result Eval." // [THEN] Value 0.9 (below dynamic range min) evaluates to FAIL LibraryAssert.AreEqual( 'FAIL', - QltyResultEvaluation.EvaluateResult( + QltyInspectionUtility.EvaluateResult( QltyInspectionHeader, UsesReferenceQltyInspectionLine, QltyIResultConditConf, @@ -1165,8 +1157,8 @@ codeunit 139963 "Qlty. Tests - Result Eval." ExpectedQltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; ActualQltyIResultConditConf: Record "Qlty. I. Result Condit. Conf."; QltyInspectionCreate: Codeunit "Qlty. Inspection - Create"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; + QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; OrdersList: List of [Code[20]]; ProductionOrder: Code[20]; @@ -1329,8 +1321,8 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionTemplateHdr: Record "Qlty. Inspection Template Hdr."; OriginalQltyInspectionTemplateLine: Record "Qlty. Inspection Template Line"; DecimalQltyTest: Record "Qlty. Test"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; + QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; begin // [SCENARIO] Validate that decimal field default values must fall within allowable values range (1..3) @@ -1379,8 +1371,8 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionTemplateHdr: Record "Qlty. Inspection Template Hdr."; OriginalQltyInspectionTemplateLine: Record "Qlty. Inspection Template Line"; OptionListQltyTest: Record "Qlty. Test"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; + QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; begin // [SCENARIO] Validate that option field default values must be one of the allowable comma-delimited options (A,B,C,D) @@ -1433,8 +1425,8 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionTemplateHdr: Record "Qlty. Inspection Template Hdr."; OriginalQltyInspectionTemplateLine: Record "Qlty. Inspection Template Line"; IntegerQltyTest: Record "Qlty. Test"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; + QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; begin // [SCENARIO] Validate that integer field default values must fall within allowable values range (1..3) @@ -1482,8 +1474,8 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionTemplateHdr: Record "Qlty. Inspection Template Hdr."; OriginalQltyInspectionTemplateLine: Record "Qlty. Inspection Template Line"; TextQltyTest: Record "Qlty. Test"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; + QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; begin // [SCENARIO] Validate that text field default values must be one of the allowable pipe-delimited options (A|B|C) @@ -1527,8 +1519,8 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionTemplateHdr: Record "Qlty. Inspection Template Hdr."; OriginalQltyInspectionTemplateLine: Record "Qlty. Inspection Template Line"; DateQltyTest: Record "Qlty. Test"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; + QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; begin // [SCENARIO] Validate that date field default values must match the exact allowable date value @@ -1572,8 +1564,8 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionTemplateHdr: Record "Qlty. Inspection Template Hdr."; OriginalQltyInspectionTemplateLine: Record "Qlty. Inspection Template Line"; DateTimeQltyTest: Record "Qlty. Test"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; + QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; begin // [SCENARIO] Validate that datetime field default values must match the exact allowable datetime value @@ -1617,8 +1609,8 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionTemplateHdr: Record "Qlty. Inspection Template Hdr."; OriginalQltyInspectionTemplateLine: Record "Qlty. Inspection Template Line"; BooleanQltyTest: Record "Qlty. Test"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; + QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; begin // [SCENARIO] Validate that boolean field default values must match the allowable boolean value and accept equivalent representations @@ -1714,8 +1706,8 @@ codeunit 139963 "Qlty. Tests - Result Eval." TextQltyTest: Record "Qlty. Test"; QltyInspectionHeader: Record "Qlty. Inspection Header"; QltyInspectionLine: Record "Qlty. Inspection Line"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; + QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionCreate: Codeunit "Qlty. Inspection - Create"; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; OrdersList: List of [Code[20]]; @@ -1763,14 +1755,14 @@ codeunit 139963 "Qlty. Tests - Result Eval." // [WHEN] Default value is set to 'A' (in allowable values) TextQltyTest."Default Value" := 'A'; // [THEN] Validation passes with inspection header context - QltyInspectionUtility.ValidateAllowableValuesOnTest(TextQltyTest, QltyInspectionHeader); + QltyResultEvaluation.ValidateAllowableValuesOnTest(TextQltyTest, QltyInspectionHeader, QltyInspectionLine); // [THEN] Validation passes with inspection header and inspection line context QltyResultEvaluation.ValidateAllowableValuesOnTest(TextQltyTest, QltyInspectionHeader, QltyInspectionLine); // [THEN] Default value 'D' (not in allowable values) causes error with inspection header context ClearLastError(); TextQltyTest."Default Value" := 'D'; - asserterror QltyInspectionUtility.ValidateAllowableValuesOnTest(TextQltyTest, QltyInspectionHeader); + asserterror QltyResultEvaluation.ValidateAllowableValuesOnTest(TextQltyTest, QltyInspectionHeader, QltyInspectionLine); // [THEN] Default value 'D' causes error with inspection header and inspection line context asserterror QltyResultEvaluation.ValidateAllowableValuesOnTest(TextQltyTest, QltyInspectionHeader, QltyInspectionLine); ClearLastError(); @@ -1900,8 +1892,8 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionHeader: Record "Qlty. Inspection Header"; NumericMeasureQltyInspectionLine: Record "Qlty. Inspection Line"; QltyInspectionCreate: Codeunit "Qlty. Inspection - Create"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; + QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; OrdersList: List of [Code[20]]; ProductionOrder: Code[20]; @@ -2019,8 +2011,8 @@ codeunit 139963 "Qlty. Tests - Result Eval." QltyInspectionHeader: Record "Qlty. Inspection Header"; OptionListQltyInspectionLine: Record "Qlty. Inspection Line"; QltyInspectionCreate: Codeunit "Qlty. Inspection - Create"; - QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyInspectionUtility: Codeunit "Qlty. Inspection Utility"; + QltyResultEvaluation: Codeunit "Qlty. Result Evaluation"; QltyProdOrderGenerator: Codeunit "Qlty. Prod. Order Generator"; OrdersList: List of [Code[20]]; ProductionOrder: Code[20]; diff --git a/src/System Application/App/AI/src/Copilot/CopilotCapEarlyPreview.Page.al b/src/System Application/App/AI/src/Copilot/CopilotCapEarlyPreview.Page.al index 2867bfd02e..18ae0e9764 100644 --- a/src/System Application/App/AI/src/Copilot/CopilotCapEarlyPreview.Page.al +++ b/src/System Application/App/AI/src/Copilot/CopilotCapEarlyPreview.Page.al @@ -16,7 +16,7 @@ page 7770 "Copilot Cap. Early Preview" Editable = false; Extensible = false; SourceTable = "Copilot Settings"; - SourceTableView = where(Availability = const("Early Preview"), "Service Type" = const("Azure AI Service Type"::"Azure OpenAI")); + SourceTableView = where(Availability = const("Early Preview"), "Service Type" = const("Azure AI Service Type"::"Azure OpenAI"), "App Installed" = const(true)); Permissions = tabledata "Copilot Settings" = rm; InherentEntitlements = X; InherentPermissions = X; @@ -48,7 +48,7 @@ page 7770 "Copilot Cap. Early Preview" SetStatusStyle(); end; } - field(Publisher; Rec.Publisher) + field(Publisher; Rec."App Publisher") { ApplicationArea = All; Caption = 'Publisher'; diff --git a/src/System Application/App/AI/src/Copilot/CopilotCapabilitiesGA.Page.al b/src/System Application/App/AI/src/Copilot/CopilotCapabilitiesGA.Page.al index 562976fbc9..880cdcbcf9 100644 --- a/src/System Application/App/AI/src/Copilot/CopilotCapabilitiesGA.Page.al +++ b/src/System Application/App/AI/src/Copilot/CopilotCapabilitiesGA.Page.al @@ -16,7 +16,7 @@ page 7774 "Copilot Capabilities GA" Editable = false; Extensible = false; SourceTable = "Copilot Settings"; - SourceTableView = where(Availability = const("Generally Available"), "Service Type" = const("Azure AI Service Type"::"Azure OpenAI")); + SourceTableView = where(Availability = const("Generally Available"), "Service Type" = const("Azure AI Service Type"::"Azure OpenAI"), "App Installed" = const(true)); Permissions = tabledata "Copilot Settings" = rm; InherentEntitlements = X; InherentPermissions = X; @@ -48,7 +48,7 @@ page 7774 "Copilot Capabilities GA" SetStatusStyle(); end; } - field(Publisher; Rec.Publisher) + field(Publisher; Rec."App Publisher") { ApplicationArea = All; Caption = 'Publisher'; diff --git a/src/System Application/App/AI/src/Copilot/CopilotCapabilitiesPreview.Page.al b/src/System Application/App/AI/src/Copilot/CopilotCapabilitiesPreview.Page.al index e0b8f1150a..e010cf7e58 100644 --- a/src/System Application/App/AI/src/Copilot/CopilotCapabilitiesPreview.Page.al +++ b/src/System Application/App/AI/src/Copilot/CopilotCapabilitiesPreview.Page.al @@ -16,7 +16,7 @@ page 7773 "Copilot Capabilities Preview" Editable = false; Extensible = false; SourceTable = "Copilot Settings"; - SourceTableView = where(Availability = const(Preview), "Service Type" = const("Azure AI Service Type"::"Azure OpenAI")); + SourceTableView = where(Availability = const(Preview), "Service Type" = const("Azure AI Service Type"::"Azure OpenAI"), "App Installed" = const(true)); Permissions = tabledata "Copilot Settings" = rm; InherentEntitlements = X; InherentPermissions = X; @@ -48,7 +48,7 @@ page 7773 "Copilot Capabilities Preview" SetStatusStyle(); end; } - field(Publisher; Rec.Publisher) + field(Publisher; Rec."App Publisher") { ApplicationArea = All; Caption = 'Publisher'; diff --git a/src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al b/src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al index 20e06c54e3..dacbc0e3e3 100644 --- a/src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al +++ b/src/System Application/App/AI/src/Copilot/CopilotCapabilityImpl.Codeunit.al @@ -84,7 +84,6 @@ codeunit 7774 "Copilot Capability Impl" CopilotSettings.Init(); CopilotSettings.Capability := CopilotCapability; CopilotSettings."App Id" := CallerModuleInfo.Id(); - CopilotSettings.Publisher := CopyStr(CallerModuleInfo.Publisher, 1, MaxStrLen(CopilotSettings.Publisher)); CopilotSettings.Availability := CopilotAvailability; CopilotSettings."Learn More Url" := LearnMoreUrl; CopilotSettings."Service Type" := AzureAIServiceType; diff --git a/src/System Application/App/AI/src/Copilot/CopilotSettings.Table.al b/src/System Application/App/AI/src/Copilot/CopilotSettings.Table.al index 9d6dd7cb8b..cba04def43 100644 --- a/src/System Application/App/AI/src/Copilot/CopilotSettings.Table.al +++ b/src/System Application/App/AI/src/Copilot/CopilotSettings.Table.al @@ -4,6 +4,7 @@ // ------------------------------------------------------------------------------------------------ namespace System.AI; +using System.Apps; using System.Privacy; /// @@ -31,10 +32,20 @@ table 7775 "Copilot Settings" { DataClassification = SystemMetadata; } +#if not CLEANSCHEMA31 field(4; Publisher; Text[2048]) { DataClassification = SystemMetadata; +#if not CLEAN28 + ObsoleteState = Pending; + ObsoleteTag = '28.0'; +#else + ObsoleteState = Removed; + ObsoleteTag = '31.0'; +#endif + ObsoleteReason = 'Replaced by "App Publisher" field which is populated from NAV App Installed table based on the App Id.'; } +#endif field(5; Status; Enum "Copilot Status") { DataClassification = SystemMetadata; @@ -53,6 +64,16 @@ table 7775 "Copilot Settings" DataClassification = SystemMetadata; ValuesAllowed = "Not Billed", "Microsoft Billed", "Custom Billed"; } + field(9; "App Installed"; Boolean) + { + FieldClass = FlowField; + CalcFormula = exist("NAV App Installed App" where("App ID" = field("App Id"))); + } + field(10; "App Publisher"; Text[250]) + { + FieldClass = FlowField; + CalcFormula = lookup("NAV App Installed App".Publisher where("App ID" = field("App Id"))); + } } keys diff --git a/src/System Application/App/Barcode/src/IDAutomation 2D Provider/Encoders/IDA2DDataMatrixEncoder.Codeunit.al b/src/System Application/App/Barcode/src/IDAutomation 2D Provider/Encoders/IDA2DDataMatrixEncoder.Codeunit.al index 2b7fcb25ab..3c843c033c 100644 --- a/src/System Application/App/Barcode/src/IDAutomation 2D Provider/Encoders/IDA2DDataMatrixEncoder.Codeunit.al +++ b/src/System Application/App/Barcode/src/IDAutomation 2D Provider/Encoders/IDA2DDataMatrixEncoder.Codeunit.al @@ -22,7 +22,9 @@ codeunit 9217 "IDA 2D Data Matrix Encoder" implements "Barcode Font Encoder 2D" begin DotNetFontEncoder := DotNetFontEncoder.DataMatrix(); - // default options to encode for the fonts we provide. - exit(DotNetFontEncoder.EncodeDM(InputText, true, EncodingModes::ASCII, -1, OutputTypes::IDA2DFont, NullString)); + // Enum value for the Ascii encoding as the enum name have changed from ASCII to Ascii in the .Net library and we want to avoid breaking changes in our code. This is the + // default options to encode for the fonts we provide. + EncodingModes := 3; + exit(DotNetFontEncoder.EncodeDM(InputText, true, EncodingModes, -1, OutputTypes::IDA2DFont, NullString)); end; } \ No newline at end of file diff --git a/src/System Application/App/Microsoft User Feedback/src/MicrosoftUserFeedback.Codeunit.al b/src/System Application/App/Microsoft User Feedback/src/MicrosoftUserFeedback.Codeunit.al index d39f25bb68..13ad3b3e6c 100644 --- a/src/System Application/App/Microsoft User Feedback/src/MicrosoftUserFeedback.Codeunit.al +++ b/src/System Application/App/Microsoft User Feedback/src/MicrosoftUserFeedback.Codeunit.al @@ -18,6 +18,8 @@ codeunit 1590 "Microsoft User Feedback" /// Requests general feedback for a feature, optionally specifying if it is a Copilot feature and its area. /// /// The name of the feature for which feedback is requested. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure RequestFeedback(FeatureName: Text) var CallerModuleInfo: ModuleInfo; @@ -27,6 +29,7 @@ codeunit 1590 "Microsoft User Feedback" NavApp.GetCallerModuleInfo(CallerModuleInfo); this.FeedbackImpl.RequestFeedback(FeatureName, '', '', EmptyContextFiles, EmptyContextProperties, CallerModuleInfo); end; +#pragma warning restore AS0022 /// /// Requests general feedback for a feature, optionally specifying if it is a Copilot feature and its area. @@ -34,6 +37,8 @@ codeunit 1590 "Microsoft User Feedback" /// The name of the feature for which feedback is requested. /// The area or sub-area of the feature. ID on OCV. /// The display name of the feature area. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure RequestFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text) var CallerModuleInfo: ModuleInfo; @@ -43,6 +48,7 @@ codeunit 1590 "Microsoft User Feedback" NavApp.GetCallerModuleInfo(CallerModuleInfo); this.FeedbackImpl.RequestFeedback(FeatureName, FeatureArea, FeatureAreaDisplayName, EmptyContextFiles, EmptyContextProperties, CallerModuleInfo); end; +#pragma warning restore AS0022 /// /// Requests general feedback for a feature, optionally specifying if it is a Copilot feature and its area. @@ -52,6 +58,8 @@ codeunit 1590 "Microsoft User Feedback" /// The display name of the feature area. /// Map of filename to base64 file to attach to the feedback. Must contain the filename in the extension. /// Additional data to pass properties to the feedback mechanism. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure RequestFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text; ContextFiles: Dictionary of [Text, Text]; ContextProperties: Dictionary of [Text, Text]) var CallerModuleInfo: ModuleInfo; @@ -59,11 +67,14 @@ codeunit 1590 "Microsoft User Feedback" NavApp.GetCallerModuleInfo(CallerModuleInfo); this.FeedbackImpl.RequestFeedback(FeatureName, FeatureArea, FeatureAreaDisplayName, ContextFiles, ContextProperties, CallerModuleInfo); end; +#pragma warning restore AS0022 /// /// Requests a 'like' (positive) feedback for a feature, optionally specifying if it is a Copilot feature and its area. /// /// The name of the feature for which like feedback is requested. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure RequestLikeFeedback(FeatureName: Text) var CallerModuleInfo: ModuleInfo; @@ -73,6 +84,7 @@ codeunit 1590 "Microsoft User Feedback" NavApp.GetCallerModuleInfo(CallerModuleInfo); this.FeedbackImpl.RequestLikeFeedback(FeatureName, '', '', EmptyContextFiles, EmptyContextProperties, CallerModuleInfo); end; +#pragma warning restore AS0022 /// /// Requests a 'like' (positive) feedback for a feature, optionally specifying if it is a Copilot feature and its area. @@ -80,6 +92,8 @@ codeunit 1590 "Microsoft User Feedback" /// The name of the feature for which like feedback is requested. /// The area or sub-area of the feature. ID on OCV. /// The display name of the feature area. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure RequestLikeFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text) var CallerModuleInfo: ModuleInfo; @@ -89,6 +103,7 @@ codeunit 1590 "Microsoft User Feedback" NavApp.GetCallerModuleInfo(CallerModuleInfo); this.FeedbackImpl.RequestLikeFeedback(FeatureName, FeatureArea, FeatureAreaDisplayName, EmptyContextFiles, EmptyContextProperties, CallerModuleInfo); end; +#pragma warning restore AS0022 /// /// Requests a 'like' (positive) feedback for a feature, optionally specifying if it is a Copilot feature and its area. @@ -97,6 +112,8 @@ codeunit 1590 "Microsoft User Feedback" /// The area or sub-area of the feature. /// Map of filename to base64 file to attach to the feedback. Must contain the filename in the extension. /// Additional data to pass properties to the feedback mechanism. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure RequestLikeFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text; ContextFiles: Dictionary of [Text, Text]; ContextProperties: Dictionary of [Text, Text]) var CallerModuleInfo: ModuleInfo; @@ -104,11 +121,14 @@ codeunit 1590 "Microsoft User Feedback" NavApp.GetCallerModuleInfo(CallerModuleInfo); this.FeedbackImpl.RequestLikeFeedback(FeatureName, FeatureArea, FeatureAreaDisplayName, ContextFiles, ContextProperties, CallerModuleInfo); end; +#pragma warning restore AS0022 /// /// Requests a 'dislike' (negative) feedback for a feature, optionally specifying if it is a Copilot feature and its area. /// /// The name of the feature for which dislike feedback is requested. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure RequestDislikeFeedback(FeatureName: Text) var CallerModuleInfo: ModuleInfo; @@ -118,6 +138,7 @@ codeunit 1590 "Microsoft User Feedback" NavApp.GetCallerModuleInfo(CallerModuleInfo); this.FeedbackImpl.RequestDislikeFeedback(FeatureName, '', '', EmptyContextFiles, EmptyContextProperties, CallerModuleInfo); end; +#pragma warning restore AS0022 /// /// Requests a 'dislike' (negative) feedback for a feature, optionally specifying if it is a Copilot feature and its area. @@ -125,6 +146,8 @@ codeunit 1590 "Microsoft User Feedback" /// The name of the feature for which dislike feedback is requested. /// The area or sub-area of the feature. ID of the sub-area on OCV. /// The display name of the feature area. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure RequestDislikeFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text) var CallerModuleInfo: ModuleInfo; @@ -134,6 +157,7 @@ codeunit 1590 "Microsoft User Feedback" NavApp.GetCallerModuleInfo(CallerModuleInfo); this.FeedbackImpl.RequestDislikeFeedback(FeatureName, FeatureArea, FeatureAreaDisplayName, EmptyContextFiles, EmptyContextProperties, CallerModuleInfo); end; +#pragma warning restore AS0022 /// /// Requests a 'dislike' (negative) feedback for a feature, optionally specifying if it is a Copilot feature and its area. @@ -141,26 +165,32 @@ codeunit 1590 "Microsoft User Feedback" /// The name of the feature for which dislike feedback is requested. /// The area or sub-area of the feature. ID of the sub-area on OCV. /// The display name of the feature area. - /// Additional data to pass properties to the feedback mechanism. /// Map of filename to base64 file to attach to the feedback. Must contain the filename in the extension. - procedure RequestDislikeFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text; ContextProperties: Dictionary of [Text, Text]; ContextFiles: Dictionary of [Text, Text]) + /// Additional data to pass properties to the feedback mechanism. +#pragma warning disable AS0022 + [Scope('OnPrem')] + procedure RequestDislikeFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text; ContextFiles: Dictionary of [Text, Text]; ContextProperties: Dictionary of [Text, Text]) var CallerModuleInfo: ModuleInfo; begin NavApp.GetCallerModuleInfo(CallerModuleInfo); this.FeedbackImpl.RequestDislikeFeedback(FeatureName, FeatureArea, FeatureAreaDisplayName, ContextFiles, ContextProperties, CallerModuleInfo); end; +#pragma warning restore AS0022 /// /// Sets whether the General/Like/Dislike feedback being collected is for an AI feature. /// /// True if the feedback is for an AI feature; otherwise, false. /// The current instance of the "Microsoft User Feedback Impl" codeunit. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure SetIsAIFeedback(IsAIFeedback: Boolean): Codeunit "Microsoft User Feedback" begin this.FeedbackImpl := this.FeedbackImpl.SetIsAIFeedback(IsAIFeedback); exit(this); end; +#pragma warning restore AS0022 /// /// Sets a custom question to be included in the feedback prompt. @@ -168,22 +198,28 @@ codeunit 1590 "Microsoft User Feedback" /// The text of the custom question. /// The display text of the custom question. /// The current instance of the "Microsoft User Feedback Impl" codeunit. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure WithCustomQuestion(Question: Text; QuestionDisplay: Text): Codeunit "Microsoft User Feedback" begin this.FeedbackImpl := this.FeedbackImpl.WithCustomQuestion(Question, QuestionDisplay); exit(this); end; +#pragma warning restore AS0022 /// /// Sets the type of the custom question to be included in the feedback prompt. /// /// The type of the custom question. /// The current instance of the "Microsoft User Feedback Impl" codeunit. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure WithCustomQuestionType(QuestionType: Enum FeedbackQuestionType): Codeunit "Microsoft User Feedback" begin this.FeedbackImpl := this.FeedbackImpl.WithCustomQuestionType(QuestionType); exit(this); end; +#pragma warning restore AS0022 /// /// Sets the required behavior for the custom question to be included in the feedback prompt. @@ -191,22 +227,28 @@ codeunit 1590 "Microsoft User Feedback" /// The behaviour. /// If true, enables the specified required behavior; if false, disables it. /// The current instance of the "Microsoft User Feedback Impl" codeunit. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure WithCustomQuestionRequiredBehavior(RequiredBehavior: Enum FeedbackRequiredBehavior; Enabled: Boolean): Codeunit "Microsoft User Feedback" begin this.FeedbackImpl := this.FeedbackImpl.WithCustomQuestionRequiredBehavior(RequiredBehavior, Enabled); exit(this); end; +#pragma warning restore AS0022 /// /// Sets the required behavior for the custom question to be included in the feedback prompt. /// /// A dictionary defining the required behavior for the custom question. /// The current instance of the "Microsoft User Feedback Impl" codeunit. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure WithCustomQuestionRequiredBehavior(RequiredBehavior: Dictionary of [Enum FeedbackRequiredBehavior, Text]): Codeunit "Microsoft User Feedback" begin this.FeedbackImpl := this.FeedbackImpl.WithCustomQuestionRequiredBehavior(RequiredBehavior); exit(this); end; +#pragma warning restore AS0022 /// /// Adds an answer option for the custom question to be included in the feedback prompt. @@ -214,32 +256,41 @@ codeunit 1590 "Microsoft User Feedback" /// The answer option. /// The display text for the answer option. /// The current instance of the "Microsoft User Feedback Impl" codeunit. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure WithCustomQuestionAnswerOption(AnswerOption: Text; AnswerDisplayText: Text): Codeunit "Microsoft User Feedback" begin this.FeedbackImpl := this.FeedbackImpl.WithCustomQuestionAnswerOption(AnswerOption, AnswerDisplayText); exit(this); end; +#pragma warning restore AS0022 /// /// Sets the answer options for the custom question to be included in the feedback prompt. /// /// A dictionary defining the answer options for the custom question. /// The current instance of the "Microsoft User Feedback Impl" codeunit. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure WithCustomQuestionAnswerOptions(AnswerOptions: Dictionary of [Text, Text]): Codeunit "Microsoft User Feedback" begin this.FeedbackImpl := this.FeedbackImpl.WithCustomQuestionAnswerOptions(AnswerOptions); exit(this); end; +#pragma warning restore AS0022 /// /// Clears any previously set custom question. /// /// The current instance of the "Microsoft User Feedback" codeunit. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure ClearCustomQuestion(): Codeunit "Microsoft User Feedback" begin this.FeedbackImpl := this.FeedbackImpl.ClearCustomQuestion(); exit(this); end; +#pragma warning restore AS0022 /// /// Starts or stops a survey timer activity. This is used to start a timer to count up user usage @@ -247,6 +298,8 @@ codeunit 1590 "Microsoft User Feedback" /// /// The name of the activity for which the timer is started or stopped. /// If true, starts the timer; if false, stops the timer. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure SurveyTimerActivity(ActivityName: Text; Start: Boolean) var CallerModuleInfo: ModuleInfo; @@ -254,12 +307,15 @@ codeunit 1590 "Microsoft User Feedback" NavApp.GetCallerModuleInfo(CallerModuleInfo); this.FeedbackImpl.SurveyTimerActivity(ActivityName, Start, CallerModuleInfo); end; +#pragma warning restore AS0022 /// /// Sends a one-time trigger event based on a specific activity name. /// The event could be, for example, a user clicking a button /// /// The name of the activity that triggers the survey. +#pragma warning disable AS0022 + [Scope('OnPrem')] procedure SurveyTriggerActivity(ActivityName: Text) var CallerModuleInfo: ModuleInfo; @@ -267,6 +323,7 @@ codeunit 1590 "Microsoft User Feedback" NavApp.GetCallerModuleInfo(CallerModuleInfo); this.FeedbackImpl.SurveyTriggerActivity(ActivityName, CallerModuleInfo); end; +#pragma warning restore AS0022 var FeedbackImpl: Codeunit "Microsoft User Feedback Impl"; diff --git a/src/System Application/Test Library/AI/src/CopilotSettingsTestLibrary.Codeunit.al b/src/System Application/Test Library/AI/src/CopilotSettingsTestLibrary.Codeunit.al index 18aa44de86..50c1f688ca 100644 --- a/src/System Application/Test Library/AI/src/CopilotSettingsTestLibrary.Codeunit.al +++ b/src/System Application/Test Library/AI/src/CopilotSettingsTestLibrary.Codeunit.al @@ -15,6 +15,7 @@ codeunit 132934 "Copilot Settings Test Library" procedure FindFirst(): Boolean begin + CopilotSettings.SetAutoCalcFields("App Publisher"); exit(CopilotSettings.FindFirst()); end; @@ -45,7 +46,7 @@ codeunit 132934 "Copilot Settings Test Library" procedure GetPublisher(): Text begin - exit(CopilotSettings."Publisher"); + exit(CopilotSettings."App Publisher"); end; procedure GetBillingType(): Enum "Copilot Billing Type" diff --git a/src/System Application/Test/DisabledTests/IDAutomation2DTest.DisabledTest.json b/src/System Application/Test/DisabledTests/IDAutomation2DTest.DisabledTest.json deleted file mode 100644 index 88449bf716..0000000000 --- a/src/System Application/Test/DisabledTests/IDAutomation2DTest.DisabledTest.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "codeunitId": 135059, - "codeunitName": "IDAutomation 2D Test", - "method": "TestDataMatrixEncoding" - }, - { - "codeunitId": 135059, - "codeunitName": "IDAutomation 2D Test", - "method": "TestMaxiCodeEncoding" - }, - { - "codeunitId": 135059, - "codeunitName": "IDAutomation 2D Test", - "method": "TestPDF417Encoding" - }, - { - "codeunitId": 135059, - "codeunitName": "IDAutomation 2D Test", - "method": "TestQRCodeEncoding" - } -]