From 25518f70c869195ae42d47c158cf925b00514932 Mon Sep 17 00:00:00 2001 From: attilatoury Date: Tue, 10 Mar 2026 16:26:50 +0100 Subject: [PATCH 1/2] [Quality Mgmt.] Bug 624560: Fixing Translated Label Inconsistencies (#7036) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes [AB#624560](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/624560) Fix translation inconsistency for inspection result codes (FAIL, INPROGRESS, PASS) The demo data app redefined the FAIL, INPROGRESS, and PASS code labels without Locked = true, while the main app's QltyAutoConfigure had them locked. In translated environments, the demo data inserted records with translated codes (e.g., IN BEARBEITUNG) that failed validation against the main app's locked values. Fix: Removed the duplicated labels from CreateQualityInspResult and replaced them with calls to new public getter procedures on QltyAutoConfigure (GetDefaultFailResult, GetDefaultInProgressResult, and corresponding description getters), ensuring the demo data always uses the exact same locked values as the main app. Also fixed EcoliPresentDescLbl which incorrectly used the raw code token 'ECOLIPRESENT' instead of a human-readable description. ADDITIONALLY: Locking all the labels used as primary key as the easiest acceptable fix for the following issue: Root cause: The Qlty. Test table's Code field has an OnValidate trigger that strips special characters (e.g. spaces). When a Tok label like 'ECOLIPRESENT' gets translated to 'ECOLI PRESENT', two things happen: InsertQualityTest validates the Code → OnValidate strips the space → record is stored as 'ECOLIPRESENT' InsertQualityInspectionTemplateLine validates "Test Code" with the raw translated value 'ECOLI PRESENT' → tries QltyTest.Get('ECOLI PRESENT') → record not found Fix: Add Locked = true to all Tok labels used as Code/identifier values in CreateQualityTest, CreateQualityLookupValue, and CreateQMInspTemplateHdr, preventing translation of these primary key values. --- .../QltyAutoConfigure.Codeunit.al | 27 ++++++- .../CreateQMInspTemplateHdr.Codeunit.al | 16 ++-- .../CreateQualityInspResult.Codeunit.al | 29 ++++---- .../CreateQualityLookupValue.Codeunit.al | 66 ++++++++--------- .../CreateQualityTest.Codeunit.al | 74 +++++++++---------- 5 files changed, 118 insertions(+), 94 deletions(-) diff --git a/src/Apps/W1/Quality Management/app/src/Configuration/QltyAutoConfigure.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Configuration/QltyAutoConfigure.Codeunit.al index 010bd4d2f9..b14cd42558 100644 --- a/src/Apps/W1/Quality Management/app/src/Configuration/QltyAutoConfigure.Codeunit.al +++ b/src/Apps/W1/Quality Management/app/src/Configuration/QltyAutoConfigure.Codeunit.al @@ -93,11 +93,36 @@ codeunit 20402 "Qlty. Auto Configure" OpenLedgerToInspectTok: Label 'ITEMLDGROPENINSPECT', MaxLength = 20, Locked = true; OpenLedgerToInspectDescriptionTxt: Label 'Open Item Ledger Entry to Inspection', MaxLength = 100; - internal procedure GetDefaultPassResult(): Text + procedure GetDefaultPassResult(): Text begin exit(DefaultResult2PassCodeTok); end; + procedure GetDefaultFailResult(): Text + begin + exit(DefaultResult1FailCodeTok); + end; + + procedure GetDefaultInProgressResult(): Text + begin + exit(DefaultResult0InProgressCodeTok); + end; + + procedure GetDefaultPassResultDescription(): Text + begin + exit(DefaultResult2PassDescriptionTxt); + end; + + procedure GetDefaultFailResultDescription(): Text + begin + exit(DefaultResult1FailDescriptionTxt); + end; + + procedure GetDefaultInProgressResultDescription(): Text + begin + exit(DefaultResult0InProgressDescriptionTxt); + end; + internal procedure EnsureBasicSetupExists(ShowMessage: Boolean) begin EnsureSetupRecordExists(); diff --git a/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQMInspTemplateHdr.Codeunit.al b/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQMInspTemplateHdr.Codeunit.al index 77023d39a8..99c19d7453 100644 --- a/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQMInspTemplateHdr.Codeunit.al +++ b/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQMInspTemplateHdr.Codeunit.al @@ -76,14 +76,14 @@ codeunit 5596 "Create QM Insp. Template Hdr" end; var - BicycleChecklistTok: Label 'BICYCLECHECKLIST', MaxLength = 20; - CarTok: Label 'CAR', MaxLength = 20; - PackagingTok: Label 'PACKAGING', MaxLength = 20; - PathogenTok: Label 'PATHOGEN', MaxLength = 20; - ProductionTok: Label 'PRODUCTION', MaxLength = 20; - ProductionFoodTok: Label 'PRODUCTIONFOOD', MaxLength = 20; - ReceiveTok: Label 'RECEIVE', MaxLength = 20; - ScheduleChangeTok: Label 'SCHEDULECHANGE', MaxLength = 20; + BicycleChecklistTok: Label 'BICYCLECHECKLIST', Locked = true, MaxLength = 20; + CarTok: Label 'CAR', Locked = true, MaxLength = 20; + PackagingTok: Label 'PACKAGING', Locked = true, MaxLength = 20; + PathogenTok: Label 'PATHOGEN', Locked = true, MaxLength = 20; + ProductionTok: Label 'PRODUCTION', Locked = true, MaxLength = 20; + ProductionFoodTok: Label 'PRODUCTIONFOOD', Locked = true, MaxLength = 20; + ReceiveTok: Label 'RECEIVE', Locked = true, MaxLength = 20; + ScheduleChangeTok: Label 'SCHEDULECHANGE', Locked = true, MaxLength = 20; BicycleChecklistDescLbl: Label 'Bicycle Checklist', MaxLength = 100; CorrectiveActionDescLbl: Label 'Corrective Action', MaxLength = 100; diff --git a/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityInspResult.Codeunit.al b/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityInspResult.Codeunit.al index c66d03b1df..a2051553f5 100644 --- a/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityInspResult.Codeunit.al +++ b/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityInspResult.Codeunit.al @@ -5,6 +5,7 @@ namespace Microsoft.DemoData.QualityManagement; using Microsoft.DemoTool.Helpers; +using Microsoft.QualityManagement.Configuration; using Microsoft.QualityManagement.Configuration.Result; codeunit 5595 "Create Quality Insp. Result" @@ -15,33 +16,31 @@ codeunit 5595 "Create Quality Insp. Result" trigger OnRun() var ContosoQualityManagement: Codeunit "Contoso Quality Management"; + QltyAutoConfigure: Codeunit "Qlty. Auto Configure"; begin - ContosoQualityManagement.InsertQualityInspectionResult(Fail(), FailDescLbl, 1, Enum::"Qlty. Result Copy Behavior"::"Automatically copy the result", Enum::"Qlty. Result Visibility"::"Configuration only", '<>0', '<>""', 'No', Enum::"Qlty. Result Category"::"Not acceptable", Enum::"Qlty. Result Finish Allowed"::"Allow Finish"); - ContosoQualityManagement.InsertQualityInspectionResult(InProgress(), InProgressDescLbl, 0, Enum::"Qlty. Result Copy Behavior"::"Automatically copy the result", Enum::"Qlty. Result Visibility"::"Configuration only", '', '', '', Enum::"Qlty. Result Category"::Uncategorized, Enum::"Qlty. Result Finish Allowed"::"Allow Finish"); - ContosoQualityManagement.InsertQualityInspectionResult(Pass(), PassDescLbl, 2, Enum::"Qlty. Result Copy Behavior"::"Automatically copy the result", Enum::"Qlty. Result Visibility"::Promoted, '<>0', '<>""', 'Yes', Enum::"Qlty. Result Category"::Acceptable, Enum::"Qlty. Result Finish Allowed"::"Allow Finish"); + ContosoQualityManagement.InsertQualityInspectionResult(Fail(), QltyAutoConfigure.GetDefaultFailResultDescription(), 1, Enum::"Qlty. Result Copy Behavior"::"Automatically copy the result", Enum::"Qlty. Result Visibility"::"Configuration only", '<>0', '<>""', 'No', Enum::"Qlty. Result Category"::"Not acceptable", Enum::"Qlty. Result Finish Allowed"::"Allow Finish"); + ContosoQualityManagement.InsertQualityInspectionResult(InProgress(), QltyAutoConfigure.GetDefaultInProgressResultDescription(), 0, Enum::"Qlty. Result Copy Behavior"::"Automatically copy the result", Enum::"Qlty. Result Visibility"::"Configuration only", '', '', '', Enum::"Qlty. Result Category"::Uncategorized, Enum::"Qlty. Result Finish Allowed"::"Allow Finish"); + ContosoQualityManagement.InsertQualityInspectionResult(Pass(), QltyAutoConfigure.GetDefaultPassResultDescription(), 2, Enum::"Qlty. Result Copy Behavior"::"Automatically copy the result", Enum::"Qlty. Result Visibility"::Promoted, '<>0', '<>""', 'Yes', Enum::"Qlty. Result Category"::Acceptable, Enum::"Qlty. Result Finish Allowed"::"Allow Finish"); end; procedure Fail(): Code[20] + var + QltyAutoConfigure: Codeunit "Qlty. Auto Configure"; begin - exit(FailTok); + exit(QltyAutoConfigure.GetDefaultFailResult()); end; procedure InProgress(): Code[20] + var + QltyAutoConfigure: Codeunit "Qlty. Auto Configure"; begin - exit(InProgressTok); + exit(QltyAutoConfigure.GetDefaultInProgressResult()); end; procedure Pass(): Code[20] + var + QltyAutoConfigure: Codeunit "Qlty. Auto Configure"; begin - exit(PassTok); + exit(QltyAutoConfigure.GetDefaultPassResult()); end; - - var - FailTok: Label 'FAIL', MaxLength = 20; - InProgressTok: Label 'INPROGRESS', MaxLength = 20; - PassTok: Label 'PASS', MaxLength = 20; - - FailDescLbl: Label 'Fail', MaxLength = 100; - InProgressDescLbl: Label 'In Progress', MaxLength = 100; - PassDescLbl: Label 'Pass', MaxLength = 100; } diff --git a/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityLookupValue.Codeunit.al b/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityLookupValue.Codeunit.al index 2ee4058ea6..cb30bfb0df 100644 --- a/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityLookupValue.Codeunit.al +++ b/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityLookupValue.Codeunit.al @@ -209,39 +209,39 @@ codeunit 5594 "Create Quality Lookup Value" end; var - EcoliPresentTok: Label 'ECOLIPRESENT', MaxLength = 20; - NcrClassificationTok: Label 'NCRCLASSIFICATION', MaxLength = 20; - OdorTok: Label 'ODOR', MaxLength = 20; - PackagingVisualTok: Label 'PACKAGINGVISUAL', MaxLength = 20; - ShippingLabelTok: Label 'SHIPPINGLABEL', MaxLength = 20; - TypeOfCarTok: Label 'TYPEOFCAR', MaxLength = 20; - CoffeeDefectTok: Label 'COFFEE_DEFECT', MaxLength = 20; - CoffeeUniformityTok: Label 'COFFEE_UNIFORMITY', MaxLength = 20; - - AbsentTok: Label 'ABSENT', MaxLength = 100; - PresentTok: Label 'PRESENT', MaxLength = 100; - MajorTok: Label 'MAJOR', MaxLength = 100; - MinorTok: Label 'MINOR', MaxLength = 100; - BadOdorTok: Label 'BADODOR', MaxLength = 100; - MildOdorTok: Label 'MILDODOR', MaxLength = 100; - NoOdorTok: Label 'NOODOR', MaxLength = 100; - HeavyTok: Label 'HEAVY', MaxLength = 100; - LightTok: Label 'LIGHT', MaxLength = 100; - UndamagedTok: Label 'UNDAMAGED', MaxLength = 100; - BadPositionTok: Label 'BADPOSITION', MaxLength = 100; - BlurredTok: Label 'BLURRED', MaxLength = 100; - DamageTok: Label 'DAMAGE', MaxLength = 100; - GoodTok: Label 'GOOD', MaxLength = 100; - ACarTok: Label 'ACAR', MaxLength = 100; - ICarTok: Label 'ICAR', MaxLength = 100; - SCarTok: Label 'SCAR', MaxLength = 100; - CoffeeDefectColorTok: Label 'COLOR', MaxLength = 100; - CoffeeDefectForeignTok: Label 'FOREIGN', MaxLength = 100; - CoffeeDefectInsectTok: Label 'INSECT', MaxLength = 100; - CoffeeDefectOdorTok: Label 'ODOR', MaxLength = 100; - CoffeeUniformityIrregularTok: Label 'IRREGULAR', MaxLength = 100; - CoffeeUniformityMixedTok: Label 'MIXED', MaxLength = 100; - CoffeeUniformityUniformTok: Label 'UNIFORM', MaxLength = 100; + EcoliPresentTok: Label 'ECOLIPRESENT', Locked = true, MaxLength = 20; + NcrClassificationTok: Label 'NCRCLASSIFICATION', Locked = true, MaxLength = 20; + OdorTok: Label 'ODOR', Locked = true, MaxLength = 20; + PackagingVisualTok: Label 'PACKAGINGVISUAL', Locked = true, MaxLength = 20; + ShippingLabelTok: Label 'SHIPPINGLABEL', Locked = true, MaxLength = 20; + TypeOfCarTok: Label 'TYPEOFCAR', Locked = true, MaxLength = 20; + CoffeeDefectTok: Label 'COFFEE_DEFECT', Locked = true, MaxLength = 20; + CoffeeUniformityTok: Label 'COFFEE_UNIFORMITY', Locked = true, MaxLength = 20; + + AbsentTok: Label 'ABSENT', Locked = true, MaxLength = 100; + PresentTok: Label 'PRESENT', Locked = true, MaxLength = 100; + MajorTok: Label 'MAJOR', Locked = true, MaxLength = 100; + MinorTok: Label 'MINOR', Locked = true, MaxLength = 100; + BadOdorTok: Label 'BADODOR', Locked = true, MaxLength = 100; + MildOdorTok: Label 'MILDODOR', Locked = true, MaxLength = 100; + NoOdorTok: Label 'NOODOR', Locked = true, MaxLength = 100; + HeavyTok: Label 'HEAVY', Locked = true, MaxLength = 100; + LightTok: Label 'LIGHT', Locked = true, MaxLength = 100; + UndamagedTok: Label 'UNDAMAGED', Locked = true, MaxLength = 100; + BadPositionTok: Label 'BADPOSITION', Locked = true, MaxLength = 100; + BlurredTok: Label 'BLURRED', Locked = true, MaxLength = 100; + DamageTok: Label 'DAMAGE', Locked = true, MaxLength = 100; + GoodTok: Label 'GOOD', Locked = true, MaxLength = 100; + ACarTok: Label 'ACAR', Locked = true, MaxLength = 100; + ICarTok: Label 'ICAR', Locked = true, MaxLength = 100; + SCarTok: Label 'SCAR', Locked = true, MaxLength = 100; + CoffeeDefectColorTok: Label 'COLOR', Locked = true, MaxLength = 100; + CoffeeDefectForeignTok: Label 'FOREIGN', Locked = true, MaxLength = 100; + CoffeeDefectInsectTok: Label 'INSECT', Locked = true, MaxLength = 100; + CoffeeDefectOdorTok: Label 'ODOR', Locked = true, MaxLength = 100; + CoffeeUniformityIrregularTok: Label 'IRREGULAR', Locked = true, MaxLength = 100; + CoffeeUniformityMixedTok: Label 'MIXED', Locked = true, MaxLength = 100; + CoffeeUniformityUniformTok: Label 'UNIFORM', Locked = true, MaxLength = 100; NoEColiDetectedLbl: Label 'No E-Coli detected', MaxLength = 250; AnyEColiDetectedLbl: Label 'Any E-Coli detected', MaxLength = 250; diff --git a/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityTest.Codeunit.al b/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityTest.Codeunit.al index 9c4e539f66..acf0c0b2af 100644 --- a/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityTest.Codeunit.al +++ b/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityTest.Codeunit.al @@ -246,42 +246,42 @@ codeunit 5593 "Create Quality Test" end; var - ApcPerGramTok: Label 'APCPERGRAM', MaxLength = 20; - BrakesCheckTok: Label 'BRAKESCHECK', MaxLength = 20; - CarContainmentTok: Label 'CARCONTAINMENT', MaxLength = 20; - CarRequestedDateTok: Label 'CARREQUESTEDDATE', MaxLength = 20; - CarTypeTok: Label 'CARTYPE', MaxLength = 20; - ColiformCountTok: Label 'COLIFORMCOUNT', MaxLength = 20; - CorrectiveActionTok: Label 'CORRECTIVEACTION', MaxLength = 20; - CustomerServiceRepreTok: Label 'CUSTOMERSERVICEREPRE', MaxLength = 20; - DescriptionOfNonConfTok: Label 'DESCRIPTIONOFNONCONF', MaxLength = 20; - EcoliPresentTok: Label 'ECOLIPRESENT', MaxLength = 20; - ExplanationTok: Label 'EXPLANATION', MaxLength = 20; - GearShiftCheckTok: Label 'GEARSHIFTCHECK', MaxLength = 20; - HandlebarAlignedTok: Label 'HANDLEBARALIGNED', MaxLength = 20; - LblNcrDetailTok: Label 'LBLNCRDETAIL', MaxLength = 20; - LblNcrPlannedActionTok: Label 'LBLNCRPLANNEDACTION', MaxLength = 20; - LblVerificationTok: Label 'LBLVERIFICATION', MaxLength = 20; - NcrClassificationTok: Label 'NCRCLASSIFICATION', MaxLength = 20; - NcrObjectiveEvidenceTok: Label 'NCROBJECTIVEEVIDENCE', MaxLength = 20; - NcrRequirementTok: Label 'NCRREQUIREMENT', MaxLength = 20; - OdorTok: Label 'ODOR', MaxLength = 20; - PackageHeightTok: Label 'PACKAGEHEIGHT', MaxLength = 20; - PackageLengthTok: Label 'PACKAGELENGTH', MaxLength = 20; - PackageWidthTok: Label 'PACKAGEWIDTH', MaxLength = 20; - PackagingVisualTok: Label 'PACKAGINGVISUAL', MaxLength = 20; - ReasonCodeTok: Label 'REASONCODE', MaxLength = 20; - RootCauseFindingsTok: Label 'ROOTCAUSEFINDINGS', MaxLength = 20; - ShippingLabelTok: Label 'SHIPPINGLABEL', MaxLength = 20; - TemperatureTok: Label 'TEMPERATURE', MaxLength = 20; - VerificationOfEffectiTok: Label 'VERIFICATIONOFFFECTI', MaxLength = 20; - VisualWeldCheckTok: Label 'VISUALWELDCHECK', MaxLength = 20; - CoffeeUniformityTok: Label 'COFFEE_UNIFORMITY', MaxLength = 20; - CoffeeDefectTok: Label 'COFFEE_DEFECT', MaxLength = 20; - CommentTok: Label 'COMMENT', MaxLength = 20; - MoistureTok: Label 'MOISTURE', MaxLength = 20; - LabelingTok: Label 'LABELING', MaxLength = 20; - BagWeightTok: Label 'BAG_WEIGHT', MaxLength = 20; + ApcPerGramTok: Label 'APCPERGRAM', Locked = true, MaxLength = 20; + BrakesCheckTok: Label 'BRAKESCHECK', Locked = true, MaxLength = 20; + CarContainmentTok: Label 'CARCONTAINMENT', Locked = true, MaxLength = 20; + CarRequestedDateTok: Label 'CARREQUESTEDDATE', Locked = true, MaxLength = 20; + CarTypeTok: Label 'CARTYPE', Locked = true, MaxLength = 20; + ColiformCountTok: Label 'COLIFORMCOUNT', Locked = true, MaxLength = 20; + CorrectiveActionTok: Label 'CORRECTIVEACTION', Locked = true, MaxLength = 20; + CustomerServiceRepreTok: Label 'CUSTOMERSERVICEREPRE', Locked = true, MaxLength = 20; + DescriptionOfNonConfTok: Label 'DESCRIPTIONOFNONCONF', Locked = true, MaxLength = 20; + EcoliPresentTok: Label 'ECOLIPRESENT', Locked = true, MaxLength = 20; + ExplanationTok: Label 'EXPLANATION', Locked = true, MaxLength = 20; + GearShiftCheckTok: Label 'GEARSHIFTCHECK', Locked = true, MaxLength = 20; + HandlebarAlignedTok: Label 'HANDLEBARALIGNED', Locked = true, MaxLength = 20; + LblNcrDetailTok: Label 'LBLNCRDETAIL', Locked = true, MaxLength = 20; + LblNcrPlannedActionTok: Label 'LBLNCRPLANNEDACTION', Locked = true, MaxLength = 20; + LblVerificationTok: Label 'LBLVERIFICATION', Locked = true, MaxLength = 20; + NcrClassificationTok: Label 'NCRCLASSIFICATION', Locked = true, MaxLength = 20; + NcrObjectiveEvidenceTok: Label 'NCROBJECTIVEEVIDENCE', Locked = true, MaxLength = 20; + NcrRequirementTok: Label 'NCRREQUIREMENT', Locked = true, MaxLength = 20; + OdorTok: Label 'ODOR', Locked = true, MaxLength = 20; + PackageHeightTok: Label 'PACKAGEHEIGHT', Locked = true, MaxLength = 20; + PackageLengthTok: Label 'PACKAGELENGTH', Locked = true, MaxLength = 20; + PackageWidthTok: Label 'PACKAGEWIDTH', Locked = true, MaxLength = 20; + PackagingVisualTok: Label 'PACKAGINGVISUAL', Locked = true, MaxLength = 20; + ReasonCodeTok: Label 'REASONCODE', Locked = true, MaxLength = 20; + RootCauseFindingsTok: Label 'ROOTCAUSEFINDINGS', Locked = true, MaxLength = 20; + ShippingLabelTok: Label 'SHIPPINGLABEL', Locked = true, MaxLength = 20; + TemperatureTok: Label 'TEMPERATURE', Locked = true, MaxLength = 20; + VerificationOfEffectiTok: Label 'VERIFICATIONOFFFECTI', Locked = true, MaxLength = 20; + VisualWeldCheckTok: Label 'VISUALWELDCHECK', Locked = true, MaxLength = 20; + CoffeeUniformityTok: Label 'COFFEE_UNIFORMITY', Locked = true, MaxLength = 20; + CoffeeDefectTok: Label 'COFFEE_DEFECT', Locked = true, MaxLength = 20; + CommentTok: Label 'COMMENT', Locked = true, MaxLength = 20; + MoistureTok: Label 'MOISTURE', Locked = true, MaxLength = 20; + LabelingTok: Label 'LABELING', Locked = true, MaxLength = 20; + BagWeightTok: Label 'BAGWEIGHT', Locked = true, MaxLength = 20; ApcPerGramDescLbl: Label 'Aerobic Plate Count per Gram', MaxLength = 100; BrakesCheckDescLbl: Label 'Brakes Check', MaxLength = 100; @@ -292,7 +292,7 @@ codeunit 5593 "Create Quality Test" CorrectiveActionDescLbl: Label 'Corrective Action', MaxLength = 100; CustomerServiceRepreDescLbl: Label 'Customer Service Representative', MaxLength = 100; DescriptionOfNonConfDescLbl: Label 'Description of Non Conformance', MaxLength = 100; - EcoliPresentDescLbl: Label 'ECOLIPRESENT', MaxLength = 100; + EcoliPresentDescLbl: Label 'E. coli Present', MaxLength = 100; ExplanationDescLbl: Label 'Explanation', MaxLength = 100; GearShiftCheckDescLbl: Label 'Gear Shift Check', MaxLength = 100; HandlebarAlignedDescLbl: Label 'Handlebar Aligned', MaxLength = 100; From 2c81c34e04bf5739a5742274b89124b367a376ee Mon Sep 17 00:00:00 2001 From: attilatoury Date: Wed, 11 Mar 2026 11:49:42 +0100 Subject: [PATCH 2/2] limit text and code length --- .../CreateQualityInspResult.Codeunit.al | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityInspResult.Codeunit.al b/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityInspResult.Codeunit.al index a2051553f5..6b30ded811 100644 --- a/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityInspResult.Codeunit.al +++ b/src/Apps/W1/QualityManagementContosoCoffeeDemoDataset/DemoData/2.Master Data/CreateQualityInspResult.Codeunit.al @@ -13,34 +13,46 @@ codeunit 5595 "Create Quality Insp. Result" InherentEntitlements = X; InherentPermissions = X; + var + QltyAutoConfigure: Codeunit "Qlty. Auto Configure"; + trigger OnRun() var ContosoQualityManagement: Codeunit "Contoso Quality Management"; - QltyAutoConfigure: Codeunit "Qlty. Auto Configure"; begin - ContosoQualityManagement.InsertQualityInspectionResult(Fail(), QltyAutoConfigure.GetDefaultFailResultDescription(), 1, Enum::"Qlty. Result Copy Behavior"::"Automatically copy the result", Enum::"Qlty. Result Visibility"::"Configuration only", '<>0', '<>""', 'No', Enum::"Qlty. Result Category"::"Not acceptable", Enum::"Qlty. Result Finish Allowed"::"Allow Finish"); - ContosoQualityManagement.InsertQualityInspectionResult(InProgress(), QltyAutoConfigure.GetDefaultInProgressResultDescription(), 0, Enum::"Qlty. Result Copy Behavior"::"Automatically copy the result", Enum::"Qlty. Result Visibility"::"Configuration only", '', '', '', Enum::"Qlty. Result Category"::Uncategorized, Enum::"Qlty. Result Finish Allowed"::"Allow Finish"); - ContosoQualityManagement.InsertQualityInspectionResult(Pass(), QltyAutoConfigure.GetDefaultPassResultDescription(), 2, Enum::"Qlty. Result Copy Behavior"::"Automatically copy the result", Enum::"Qlty. Result Visibility"::Promoted, '<>0', '<>""', 'Yes', Enum::"Qlty. Result Category"::Acceptable, Enum::"Qlty. Result Finish Allowed"::"Allow Finish"); + ContosoQualityManagement.InsertQualityInspectionResult(Fail(), FailDescription(), 1, Enum::"Qlty. Result Copy Behavior"::"Automatically copy the result", Enum::"Qlty. Result Visibility"::"Configuration only", '<>0', '<>""', 'No', Enum::"Qlty. Result Category"::"Not acceptable", Enum::"Qlty. Result Finish Allowed"::"Allow Finish"); + ContosoQualityManagement.InsertQualityInspectionResult(InProgress(), InProgressDescription(), 0, Enum::"Qlty. Result Copy Behavior"::"Automatically copy the result", Enum::"Qlty. Result Visibility"::"Configuration only", '', '', '', Enum::"Qlty. Result Category"::Uncategorized, Enum::"Qlty. Result Finish Allowed"::"Allow Finish"); + ContosoQualityManagement.InsertQualityInspectionResult(Pass(), PassDescription(), 2, Enum::"Qlty. Result Copy Behavior"::"Automatically copy the result", Enum::"Qlty. Result Visibility"::Promoted, '<>0', '<>""', 'Yes', Enum::"Qlty. Result Category"::Acceptable, Enum::"Qlty. Result Finish Allowed"::"Allow Finish"); end; procedure Fail(): Code[20] - var - QltyAutoConfigure: Codeunit "Qlty. Auto Configure"; begin - exit(QltyAutoConfigure.GetDefaultFailResult()); + exit(CopyStr(QltyAutoConfigure.GetDefaultFailResult(), 1, 20)); + end; + + procedure FailDescription(): Text[100] + begin + exit(CopyStr(QltyAutoConfigure.GetDefaultFailResultDescription(), 1, 100)); end; procedure InProgress(): Code[20] - var - QltyAutoConfigure: Codeunit "Qlty. Auto Configure"; begin - exit(QltyAutoConfigure.GetDefaultInProgressResult()); + exit(CopyStr(QltyAutoConfigure.GetDefaultInProgressResult(), 1, 20)); + end; + + procedure InProgressDescription(): Text[100] + begin + exit(CopyStr(QltyAutoConfigure.GetDefaultInProgressResultDescription(), 1, 100)); end; procedure Pass(): Code[20] - var - QltyAutoConfigure: Codeunit "Qlty. Auto Configure"; begin - exit(QltyAutoConfigure.GetDefaultPassResult()); + exit(CopyStr(QltyAutoConfigure.GetDefaultPassResult(), 1, 20)); end; + + procedure PassDescription(): Text[100] + begin + exit(CopyStr(QltyAutoConfigure.GetDefaultPassResultDescription(), 1, 100)); + end; + }