diff --git a/src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInspectionGenRules.Page.al b/src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInspectionGenRules.Page.al index c6f6c12312..a639ed2fc9 100644 --- a/src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInspectionGenRules.Page.al +++ b/src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInspectionGenRules.Page.al @@ -179,9 +179,53 @@ page 20405 "Qlty. Inspection Gen. Rules" actionref(CreateNewGenerationRuleForProdWizard_Promoted; CreateNewGenerationRuleForProdWizard) { } + actionref(CreateNewGenerationRuleForAsmWizard_Promoted; CreateNewGenerationRuleForAsmWizard) + { + } } area(Processing) { + action(CreateNewGenerationRuleForAsmWizard) + { + Caption = 'Create Assembly Rule'; + ToolTip = 'Specifies to create a rule for assembly.'; + Image = Receipt; + ApplicationArea = Assembly; + + trigger OnAction() + var + NewQltyInspectionGenRule: Record "Qlty. Inspection Gen. Rule"; + RecQltyAsmGenRuleWizard: Page "Qlty. Asm. Gen. Rule Wizard"; + begin + NewQltyInspectionGenRule.CopyFilters(Rec); + RecQltyAsmGenRuleWizard.RunModalWithGenerationRule(NewQltyInspectionGenRule); + CurrPage.Update(false); + end; + } + action(EditGenerationRuleForAsmWizard) + { + ApplicationArea = Assembly; + Caption = 'Edit Assembly Rule'; + ToolTip = 'Edit a Rule for assembly.'; + Image = Receipt; + Scope = Repeater; + Visible = ShowEditWizardAssemblyRule; + + trigger OnAction() + var + QltyAsmGenRuleWizard: Page "Qlty. Asm. Gen. Rule Wizard"; + PreviousEntryNo: Integer; + begin + PreviousEntryNo := Rec."Entry No."; + QltyAsmGenRuleWizard.RunModalWithGenerationRule(Rec); + + CurrPage.Update(false); + Rec.Reset(); + Rec.SetRange("Entry No.", PreviousEntryNo); + if Rec.FindSet() then; + Rec.SetRange("Entry No."); + end; + } action(CreateNewGenerationRuleForProdWizard) { Caption = 'Create Production Rule'; @@ -191,9 +235,11 @@ page 20405 "Qlty. Inspection Gen. Rules" trigger OnAction() var + NewQltyInspectionGenRule: Record "Qlty. Inspection Gen. Rule"; RecQltyProdGenRuleWizard: Page "Qlty. Prod. Gen. Rule Wizard"; begin - RecQltyProdGenRuleWizard.RunModalWithGenerationRule(Rec); + NewQltyInspectionGenRule.CopyFilters(Rec); + RecQltyProdGenRuleWizard.RunModalWithGenerationRule(NewQltyInspectionGenRule); CurrPage.Update(false); end; } @@ -230,9 +276,11 @@ page 20405 "Qlty. Inspection Gen. Rules" trigger OnAction() var + NewQltyInspectionGenRule: Record "Qlty. Inspection Gen. Rule"; QltyRecGenRuleWizard: Page "Qlty. Rec. Gen. Rule Wizard"; begin - QltyRecGenRuleWizard.RunModalWithGenerationRule(Rec); + NewQltyInspectionGenRule.CopyFilters(Rec); + QltyRecGenRuleWizard.RunModalWithGenerationRule(NewQltyInspectionGenRule); CurrPage.Update(false); end; } @@ -269,9 +317,11 @@ page 20405 "Qlty. Inspection Gen. Rules" trigger OnAction() var - RecQltyWhseGenRuleWizard: Page "Qlty. Whse. Gen. Rule Wizard"; + NewQltyInspectionGenRule: Record "Qlty. Inspection Gen. Rule"; + QltyWhseGenRuleWizard: Page "Qlty. Whse. Gen. Rule Wizard"; begin - RecQltyWhseGenRuleWizard.RunModalWithGenerationRule(Rec); + NewQltyInspectionGenRule.CopyFilters(Rec); + QltyWhseGenRuleWizard.RunModalWithGenerationRule(NewQltyInspectionGenRule); CurrPage.Update(false); end; } @@ -353,6 +403,7 @@ page 20405 "Qlty. Inspection Gen. Rules" ShowEditWizardMovementRule: Boolean; ShowEditWizardReceivingRule: Boolean; ShowEditWizardProductionRule: Boolean; + ShowEditWizardAssemblyRule: Boolean; TemplateCode: Code[20]; ShowAssemblyTrigger: Boolean; ShowProductionTrigger: Boolean; @@ -446,6 +497,7 @@ page 20405 "Qlty. Inspection Gen. Rules" ShowEditWizardProductionRule := true; ShowEditWizardReceivingRule := true; ShowEditWizardMovementRule := true; + ShowEditWizardAssemblyRule := true; EditAssemblyTrigger := true; EditProductionTrigger := true; EditPurchaseTrigger := true; @@ -467,7 +519,7 @@ page 20405 "Qlty. Inspection Gen. Rules" case KnownOrInferredIntent of Rec.Intent::Assembly: begin - ShowEditWizardProductionRule := true; + ShowEditWizardAssemblyRule := true; EditAssemblyTrigger := true; AssemblyStyle := Format(RowStyle::Standard); end; @@ -514,6 +566,7 @@ page 20405 "Qlty. Inspection Gen. Rules" begin ShowEditWizardReceivingRule := false; ShowEditWizardProductionRule := false; + ShowEditWizardAssemblyRule := false; ShowEditWizardMovementRule := false; EditProductionTrigger := false; EditAssemblyTrigger := false; diff --git a/src/Apps/W1/Quality Management/app/src/Document/QltyInspectionCreate.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Document/QltyInspectionCreate.Codeunit.al index 76f2f474e5..13323f8a50 100644 --- a/src/Apps/W1/Quality Management/app/src/Document/QltyInspectionCreate.Codeunit.al +++ b/src/Apps/W1/Quality Management/app/src/Document/QltyInspectionCreate.Codeunit.al @@ -366,6 +366,7 @@ codeunit 20404 "Qlty. Inspection - Create" if GuiAllowed() then if (not PreventShowingGeneratedInspectionEvenIfConfigured) and + (QltyInspectionHeader."No." <> '') and ((QltyManagementSetup."Show Inspection Behavior" = QltyManagementSetup."Show Inspection Behavior"::"Automatic and manually created inspections") or (IsManualCreation and (QltyManagementSetup."Show Inspection Behavior" = QltyManagementSetup."Show Inspection Behavior"::"Only manually created inspections"))) then diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Assembly/QltyAsmGenRuleWizard.Page.al b/src/Apps/W1/Quality Management/app/src/Integration/Assembly/QltyAsmGenRuleWizard.Page.al new file mode 100644 index 0000000000..06b9eb12fb --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Integration/Assembly/QltyAsmGenRuleWizard.Page.al @@ -0,0 +1,588 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Integration.Manufacturing; + +using Microsoft.Assembly.History; +using Microsoft.Inventory.Item; +using Microsoft.QualityManagement.Configuration.GenerationRule; +using Microsoft.QualityManagement.Configuration.Template; +using Microsoft.QualityManagement.Integration.Assembly; +using Microsoft.QualityManagement.Setup; +using Microsoft.QualityManagement.Utilities; + +page 20464 "Qlty. Asm. Gen. Rule Wizard" +{ + Caption = 'Quality Management - Assembly Quality Test Generation Rule Wizard'; + PageType = NavigatePage; + UsageCategory = None; + ApplicationArea = Assembly; + SourceTable = "Qlty. Management Setup"; + + layout + { + area(Content) + { + group(SettingsFor_iStepWhichTemplate) + { + Caption = ' '; + ShowCaption = false; + Visible = (StepWhichTemplateCounter = CurrentStepCounter); + + group(SettingsFor_iStepWhichTemplate_Instruction1) + { + InstructionalText = 'Define a rule for lot or serial related tests when products are assembled.'; + Caption = ' '; + ShowCaption = false; + } + group(SettingsFor_iStepWhichTemplate_Instruction2) + { + InstructionalText = 'Which Quality Inspection template do you want to use?'; + Caption = ' '; + ShowCaption = false; + } + field(ChoosechooseTemplate; TemplateCode) + { + ApplicationArea = All; + Caption = 'Choose Template'; + ToolTip = 'Specifies which Quality Inspection template do you want to use?'; + ShowMandatory = true; + + trigger OnAssistEdit() + begin + QltyFilterHelpers.AssistEditQltyInspectionTemplate(TemplateCode); + end; + } + } + + group(SettingsFor_iStepWhichAssemblyOrder) + { + ShowCaption = false; + InstructionalText = 'A test should be created for an assembly order when these filters match. You can choose other fields on the last step.'; + Visible = (StepWhichAssemblyOrderCounter = CurrentStepCounter); + + field(ChoosechooseAssemblyLocation; LocationCodeFilter) + { + ApplicationArea = All; + Caption = 'Location'; + ToolTip = 'Specifies a location filter'; + + trigger OnAssistEdit() + begin + QltyFilterHelpers.AssistEditLocation(LocationCodeFilter); + end; + + trigger OnValidate() + begin + if not UpdateFullTextRuleStringsFromFilters() then + Error(LocationFilterErr, GetLastErrorText()); + end; + } + field(ToBinCodeFilter; ToBinCodeFilter) + { + ApplicationArea = All; + Caption = 'To Bin'; + ToolTip = 'Specifies a destination bin.'; + + trigger OnAssistEdit() + begin + QltyFilterHelpers.AssistEditBin(LocationCodeFilter, '', ToBinCodeFilter); + end; + + trigger OnValidate() + begin + if not UpdateFullTextRuleStringsFromFilters() then + Error(ToBinFilterErr, GetLastErrorText()); + end; + } + field(ChooseAssemblyDescriptionPattern; DescriptionPattern) + { + ApplicationArea = All; + Caption = 'Description'; + ToolTip = 'Specifies a filter for description'; + + trigger OnValidate() + begin + UpdateFullTextRuleStringsFromFilters(); + end; + } + field(ChooseadvancedAssembly; 'Click here to choose advanced fields...') + { + ApplicationArea = All; + ShowCaption = false; + + trigger OnDrillDown() + begin + UpdateFullTextRuleStringsFromFilters(); + AssistEditFullPostedAssemblyHeaderFilter(); + UpdateTableVariablesFromRecordFilters(); + end; + } + } + group(SettingsFor_iStepWhichItem) + { + Caption = ' '; + ShowCaption = false; + InstructionalText = 'Does it matter which items? You can optionally limit this to only items that match this criteria.'; + Visible = (StepWhichItemFilterCounter = CurrentStepCounter); + + field(ChooseItemNoFilter; ItemNoFilter) + { + ApplicationArea = All; + Caption = 'Specific Item'; + ToolTip = 'Specifies a specific Item'; + + trigger OnAssistEdit() + begin + QltyFilterHelpers.AssistEditItemNo(ItemNoFilter); + end; + + trigger OnValidate() + begin + if not UpdateFullTextRuleStringsFromFilters() then + Error(ItemFilterErr, GetLastErrorText()); + end; + } + field(ChooseCategoryCodeFilter; CategoryCodeFilter) + { + ApplicationArea = All; + Caption = 'Category'; + ToolTip = 'Specifies a specific Category'; + + trigger OnAssistEdit() + begin + QltyFilterHelpers.AssistEditItemCategory(CategoryCodeFilter); + end; + + trigger OnValidate() + begin + if not UpdateFullTextRuleStringsFromFilters() then + Error(ItemCategoryFilterErr, GetLastErrorText()); + end; + } + field(ChooseInventoryPostingGroupCode; InventoryPostingGroupCode) + { + ApplicationArea = All; + Caption = 'Inventory Posting Group'; + ToolTip = 'Specifies a Inventory Posting Group'; + + trigger OnAssistEdit() + begin + QltyFilterHelpers.AssistEditInventoryPostingGroup(InventoryPostingGroupCode); + end; + + trigger OnValidate() + begin + if not UpdateFullTextRuleStringsFromFilters() then + Error(InventoryPostingGroupErr, GetLastErrorText()); + end; + } + field(Chooseadvanced_item; 'Click here to choose advanced fields...') + { + ApplicationArea = All; + ShowCaption = false; + + trigger OnDrillDown() + begin + UpdateFullTextRuleStringsFromFilters(); + AssistEditFullItemFilter(); + UpdateTableVariablesFromRecordFilters(); + end; + } + } + group(SettingsFor_iStepDone) + { + Caption = ' '; + InstructionalText = ''; + ShowCaption = false; + Visible = (StepDoneCounter = CurrentStepCounter); + + group(SettingsFor_iStepDone_Instruction1) + { + Caption = ' '; + InstructionalText = 'We have a Test Generation Rule ready. Click ''Finish'' to save this to the system.'; + ShowCaption = false; + } + group(SettingsFor_iStepDone_Instruction2) + { + Caption = ' '; + InstructionalText = 'Please review and set any additional filters you may need, for example if you want to limit this to specific items.'; + ShowCaption = false; + } + group(SettingsForWrapAssemblyOrderRule) + { + ShowCaption = false; + field(ChoosePostedAssemblyOrderRuleFilter; PostedAssemblyOrderRuleFilter) + { + ApplicationArea = All; + Caption = 'Filters'; + ToolTip = 'Specifies additional filters you may need to review and set.'; + MultiLine = true; + + trigger OnAssistEdit() + begin + AssistEditFullPostedAssemblyHeaderFilter(); + end; + } + } + field(ChooseFilters_Item; ItemRuleFilter) + { + ApplicationArea = All; + Caption = 'Item Filter'; + ToolTip = 'Specifies additional filters you may need to review and set.'; + MultiLine = true; + + trigger OnAssistEdit() + begin + AssistEditFullItemFilter(); + end; + } + group(SettingsForbAutomaticallyCreateTest) + { + ShowCaption = false; + InstructionalText = 'Do you want to automatically create tests when these are produced? This will set the activation trigger for this rule and set the default trigger value for test generation rules of this record type.'; + + group(SettingsForAutoAssemblyTriggerWrapper) + { + ShowCaption = false; + + field(ChooseAutomaticallyCreateAssemblyTest; QltyAssemblyTrigger) + { + ApplicationArea = All; + Caption = 'Automatically Create Test'; + ToolTip = 'Specifies whether to automatically create a test when product is produced.'; + } + } + } + } + } + } + + actions + { + area(Processing) + { + action(Back) + { + Caption = 'Back'; + ToolTip = 'Back'; + Enabled = IsBackEnabledd; + Image = PreviousRecord; + InFooterBar = true; + + trigger OnAction(); + begin + BackAction(); + end; + } + action(Next) + { + Caption = 'Next'; + ToolTip = 'Next'; + Enabled = IsNextEnabledd; + Image = NextRecord; + InFooterBar = true; + + trigger OnAction(); + begin + NextAction(); + end; + } + action(Finish) + { + Caption = 'Finish'; + ToolTip = 'Finish'; + Enabled = IsFinishEnabledd; + Image = Approve; + InFooterBar = true; + + trigger OnAction(); + begin + FinishAction(); + end; + } + } + } + + var + QltyManagementSetup: Record "Qlty. Management Setup"; + TempItem: Record "Item" temporary; + TempQltyInspectionGenRule: Record "Qlty. Inspection Gen. Rule" temporary; + TempPostedAssemblyHeader: Record "Posted Assembly Header" temporary; + QltyFilterHelpers: Codeunit "Qlty. Filter Helpers"; + CurrentStepCounter: Integer; + LocationCodeFilter: Code[20]; + TemplateCode: Code[20]; + SpecificNoFilter: Code[20]; + WorkCenterNo: Code[20]; + FromBinCodeFilter: Code[20]; + ToBinCodeFilter: Code[20]; + OperationNo: Code[20]; + DescriptionPattern: Text[100]; + ItemNoFilter: Code[20]; + CategoryCodeFilter: Code[20]; + InventoryPostingGroupCode: Code[20]; + QltyAssemblyTrigger: Enum "Qlty. Assembly Trigger"; + ProdOrderRoutingLineRuleFilter: Text[400]; + PostedAssemblyOrderRuleFilter: Text[400]; + ItemRuleFilter: Text[400]; + IsBackEnabledd: Boolean; + IsNextEnabledd: Boolean; + IsFinishEnabledd: Boolean; + IsMovingForward: Boolean; + IsMovingBackward: Boolean; + StepWhichTemplateCounter: Integer; + StepWhichItemFilterCounter: Integer; + StepWhichAssemblyOrderCounter: Integer; + StepDoneCounter: Integer; + MaxStep: Integer; + LocationFilterErr: Label 'This Location filter needs an adjustment. Location codes are no more than 10 characters. %1', Comment = '%1 = Text of the original error message'; + FromBinFilterErr: Label 'This From Bin filter needs an adjustment. %1', Comment = '%1 = Text of the original error message'; + ToBinFilterErr: Label 'This To Bin filter needs an adjustment. %1', Comment = '%1 = Text of the original error message'; + RoutingNoFilterErr: Label 'This Routing No. filter needs an adjustment. %1', Comment = '%1 = Text of the original error message'; + OperationNoErr: Label 'This Operation No. filter needs an adjustment. Operation Nos. are no more than 10 characters. %1', Comment = '%1 = Text of the original error message'; + MachineNoFilterErr: Label 'This Machine No. filter needs an adjustment. %1', Comment = '%1 = Text of the original error message'; + ItemFilterErr: Label 'This Item filter needs an adjustment. %1', Comment = '%1 = Text of the original error message'; + ItemCategoryFilterErr: Label 'This Item Category filter needs an adjustment. %1', Comment = '%1 = Text of the original error message'; + InventoryPostingGroupErr: Label 'This Inventory Posting Group filter needs an adjustment. %1', Comment = '%1 = Text of the original error message'; + YouMustChooseATemplateFirstMsg: Label 'Please choose a template before proceeding.'; + WorkCenterNoErr: Label 'This Work Center No. filter needs an adjustment. %1', Comment = '%1 = Text of the original error message'; + RuleAlreadyThereQst: Label 'You already have at least one rule with these same conditions. Are you sure you want to proceed?'; + FilterLengthErr: Label 'This filter is too long and must be less than %1 characters.', Comment = '%1=filter string maximum length'; + + trigger OnInit(); + begin + QltyManagementSetup.Get(); + StepWhichTemplateCounter := 1; + StepWhichAssemblyOrderCounter := 2; + StepWhichItemFilterCounter := 3; + StepDoneCounter := 4; + + InitializeDefaultValues(); + + MaxStep := StepDoneCounter; + end; + + trigger OnOpenPage(); + begin + ChangeToStep(StepWhichTemplateCounter); + Commit(); + end; + + /// + /// Intended to help initialize default values. + /// + local procedure InitializeDefaultValues() + begin + InitializeDefaultTemplate(); + end; + + local procedure InitializeDefaultTemplate() + var + QltyInspectionTemplateHdr: Record "Qlty. Inspection Template Hdr."; + begin + if TemplateCode <> '' then + exit; + + QltyInspectionTemplateHdr.SetCurrentKey(SystemModifiedAt); + QltyInspectionTemplateHdr.Ascending(false); + if QltyInspectionTemplateHdr.FindFirst() then + TemplateCode := QltyInspectionTemplateHdr.Code; + end; + + local procedure ChangeToStep(Step: Integer); + begin + if Step < 1 then + Step := 1; + + if Step > MaxStep then + Step := MaxStep; + + IsMovingForward := Step > CurrentStepCounter; + IsMovingBackward := Step < CurrentStepCounter; + + if IsMovingForward then + LeavingStepMovingForward(CurrentStepCounter, Step); + + case Step of + StepWhichTemplateCounter: + begin + IsBackEnabledd := false; + IsNextEnabledd := true; + IsFinishEnabledd := false; + end; + StepWhichAssemblyOrderCounter: + begin + IsBackEnabledd := true; + IsNextEnabledd := true; + IsFinishEnabledd := false; + end; + StepWhichItemFilterCounter: + begin + IsBackEnabledd := true; + IsNextEnabledd := true; + IsFinishEnabledd := false; + end; + StepDoneCounter: + begin + IsBackEnabledd := true; + IsNextEnabledd := false; + IsFinishEnabledd := true; + UpdateFullTextRuleStringsFromFilters(); + end; + end; + + CurrentStepCounter := Step; + + CurrPage.Update(true); + end; + + local procedure LeavingStepMovingForward(LeavingThisStep: Integer; var MovingToThisStep: Integer); + var + QltyInspectionTemplateHdr: Record "Qlty. Inspection Template Hdr."; + begin + if LeavingThisStep = StepWhichTemplateCounter then + if not QltyInspectionTemplateHdr.Get(TemplateCode) then begin + Message(YouMustChooseATemplateFirstMsg); + MovingToThisStep := StepWhichTemplateCounter; + end; + end; + + local procedure AssistEditFullItemFilter() + begin + TempQltyInspectionGenRule."Item Filter" := ItemRuleFilter; + if TempQltyInspectionGenRule.AssistEditConditionItemFilter() then begin + ItemRuleFilter := TempQltyInspectionGenRule."Item Filter"; + + TempItem.SetView(ItemRuleFilter); + UpdateTableVariablesFromRecordFilters(); + CleanUpWhereClause(); + end; + end; + + local procedure AssistEditFullPostedAssemblyHeaderFilter() + begin + TempQltyInspectionGenRule."Source Table No." := Database::"Posted Assembly Header"; + TempQltyInspectionGenRule."Condition Filter" := PostedAssemblyOrderRuleFilter; + + if TempQltyInspectionGenRule.AssistEditConditionTableFilter() then begin + PostedAssemblyOrderRuleFilter := TempQltyInspectionGenRule."Condition Filter"; + + TempPostedAssemblyHeader.SetView(PostedAssemblyOrderRuleFilter); + UpdateTableVariablesFromRecordFilters(); + CleanUpWhereClause(); + end; + end; + + local procedure CleanUpWhereClause() + begin + PostedAssemblyOrderRuleFilter := QltyFilterHelpers.CleanUpWhereClause400(PostedAssemblyOrderRuleFilter); + ItemRuleFilter := QltyFilterHelpers.CleanUpWhereClause400(ItemRuleFilter); + end; + + local procedure BackAction(); + begin + CurrPage.Update(true); + ChangeToStep(CurrentStepCounter - 1); + end; + + local procedure NextAction(); + + begin + CurrPage.Update(true); + ChangeToStep(CurrentStepCounter + 1); + end; + + local procedure FinishAction(); + var + QltyInspectionGenRule: Record "Qlty. Inspection Gen. Rule"; + ExistingQltyInspectionGenRule: Record "Qlty. Inspection Gen. Rule"; + begin + if not QltyInspectionGenRule.Get(TempQltyInspectionGenRule.RecordId()) then begin + QltyInspectionGenRule.Init(); + QltyInspectionGenRule.SetEntryNo(); + QltyInspectionGenRule.UpdateSortOrder(); + QltyInspectionGenRule.Insert(); + end; + QltyInspectionGenRule.Validate("Template Code", TemplateCode); + QltyManagementSetup.Get(); + QltyInspectionGenRule."Source Table No." := Database::"Posted Assembly Header"; + QltyInspectionGenRule.Intent := QltyInspectionGenRule.Intent::Assembly; + QltyInspectionGenRule."Condition Filter" := PostedAssemblyOrderRuleFilter; + QltyInspectionGenRule.SetIntentAndDefaultTriggerValuesFromSetup(); + QltyInspectionGenRule."Assembly Trigger" := QltyAssemblyTrigger; + QltyManagementSetup."Assembly Trigger" := QltyAssemblyTrigger; + if QltyManagementSetup.Modify(false) then; + QltyInspectionGenRule."Item Filter" := ItemRuleFilter; + QltyInspectionGenRule.Modify(); + + ExistingQltyInspectionGenRule.SetRange("Template Code", QltyInspectionGenRule."Template Code"); + ExistingQltyInspectionGenRule.SetRange("Source Table No.", QltyInspectionGenRule."Source Table No."); + ExistingQltyInspectionGenRule.SetRange("Condition Filter", QltyInspectionGenRule."Condition Filter"); + ExistingQltyInspectionGenRule.SetRange("Item Filter", QltyInspectionGenRule."Item Filter"); + if ExistingQltyInspectionGenRule.Count() > 1 then + if not Confirm(RuleAlreadyThereQst) then + Error(''); + + CurrPage.Close(); + end; + + /// + /// Start the wizard using this generation rule as a pre-requisite. + /// Use this to edit an existing rule. + /// You can also use it to start a new rule with a default template by supplying a template filter. + /// + /// + /// + procedure RunModalWithGenerationRule(var QltyInspectionGenRule: Record "Qlty. Inspection Gen. Rule"): Action + begin + TempQltyInspectionGenRule := QltyInspectionGenRule; + Clear(TempPostedAssemblyHeader); + Clear(TempItem); + + if QltyInspectionGenRule."Source Table No." = Database::"Posted Assembly Header" then begin + TempPostedAssemblyHeader.SetView(TempQltyInspectionGenRule."Condition Filter"); + end; + + TempItem.SetView(TempQltyInspectionGenRule."Item Filter"); + UpdateTableVariablesFromRecordFilters(); + + TemplateCode := QltyInspectionGenRule.GetTemplateCodeFromRecordOrFilter(false); + UpdateFullTextRuleStringsFromFilters(); + + exit(CurrPage.RunModal()); + end; + + [TryFunction] + local procedure UpdateFullTextRuleStringsFromFilters() + begin + TempPostedAssemblyHeader.SetFilter("Location Code", LocationCodeFilter); + TempPostedAssemblyHeader.SetFilter(Description, DescriptionPattern); + PostedAssemblyOrderRuleFilter := CopyStr(QltyFilterHelpers.CleanUpWhereClause400(TempPostedAssemblyHeader.GetView(true)), 1, MaxStrLen(TempQltyInspectionGenRule."Condition Filter")); + + TempItem.SetFilter("No.", ItemNoFilter); + TempItem.SetFilter("Item Category Code", CategoryCodeFilter); + TempItem.SetFilter("Inventory Posting Group", InventoryPostingGroupCode); + + ItemRuleFilter := CopyStr(QltyFilterHelpers.CleanUpWhereClause400(TempItem.GetView(true)), 1, MaxStrLen(TempQltyInspectionGenRule."Item Filter")); + CleanUpWhereClause(); + + if StrLen(QltyFilterHelpers.CleanUpWhereClause400(TempPostedAssemblyHeader.GetView(true))) > MaxStrLen(TempQltyInspectionGenRule."Condition Filter") then + Error(FilterLengthErr, MaxStrLen(TempQltyInspectionGenRule."Condition Filter")); + + if StrLen(QltyFilterHelpers.CleanUpWhereClause400(TempItem.GetView(true))) > MaxStrLen(TempQltyInspectionGenRule."Item Filter") then + Error(FilterLengthErr, MaxStrLen(TempQltyInspectionGenRule."Item Filter")); + end; + + local procedure UpdateTableVariablesFromRecordFilters() + begin + LocationCodeFilter := CopyStr(TempPostedAssemblyHeader.GetFilter("Location Code"), 1, MaxStrLen(LocationCodeFilter)); + DescriptionPattern := CopyStr(TempPostedAssemblyHeader.GetFilter(Description), 1, MaxStrLen(DescriptionPattern)); + ToBinCodeFilter := CopyStr(TempPostedAssemblyHeader.GetFilter("Bin Code"), 1, MaxStrLen(ToBinCodeFilter)); + + ItemNoFilter := CopyStr(TempItem.GetFilter("No."), 1, MaxStrLen(ItemNoFilter)); + CategoryCodeFilter := CopyStr(TempItem.GetFilter("Item Category Code"), 1, MaxStrLen(CategoryCodeFilter)); + InventoryPostingGroupCode := CopyStr(TempItem.GetFilter("Inventory Posting Group"), 1, MaxStrLen(InventoryPostingGroupCode)); + end; +} diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyProdGenRuleWizard.Page.al b/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyProdGenRuleWizard.Page.al index 534eae1efe..b7a5a50ac3 100644 --- a/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyProdGenRuleWizard.Page.al +++ b/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyProdGenRuleWizard.Page.al @@ -4,21 +4,19 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.QualityManagement.Integration.Manufacturing; -using Microsoft.Assembly.History; using Microsoft.Inventory.Item; using Microsoft.Manufacturing.Document; using Microsoft.QualityManagement.Configuration.GenerationRule; using Microsoft.QualityManagement.Configuration.Template; -using Microsoft.QualityManagement.Integration.Assembly; using Microsoft.QualityManagement.Setup; using Microsoft.QualityManagement.Utilities; page 20462 "Qlty. Prod. Gen. Rule Wizard" { - Caption = 'Quality Management - Production and Assembly Quality Inspection Generation Rule Wizard'; + Caption = 'Quality Management - Production Quality Inspection Generation Rule Wizard'; PageType = NavigatePage; UsageCategory = None; - ApplicationArea = QualityManagement; + ApplicationArea = Manufacturing; SourceTable = "Qlty. Management Setup"; layout @@ -56,39 +54,7 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" end; } } - group(SettingsFor_StepAssemblyOrProduction) - { - Caption = ' '; - ShowCaption = false; - Visible = (StepAssemblyOrProductionCounter = CurrentStepCounter); - InstructionalText = 'Choose whether this is for production orders or assembly orders.'; - - field(ChoosechooseProductionOrder; IsProductionOrder) - { - ApplicationArea = Manufacturing; - Caption = 'Production Orders'; - ToolTip = 'Specifies to create an inspection generation rule for Production Orders'; - - trigger OnValidate() - begin - if IsProductionOrder then - IsAssemblyOrder := false; - end; - } - field(ChoosechooseAssemblyOrder; IsAssemblyOrder) - { - ApplicationArea = Assembly; - Caption = 'Assembly Orders'; - ToolTip = 'Specifies to create an inspection generation rule for Assembly Orders'; - - trigger OnValidate() - begin - if IsAssemblyOrder then - IsProductionOrder := false; - end; - } - } - group(SettingsFor_StepWhichProdOrderRoutingLine) + group(SettingsFor_iStepWhichProdOrderRoutingLine) { Caption = ' '; ShowCaption = false; @@ -248,71 +214,7 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" end; } } - group(SettingsFor_StepWhichAssemblyOrder) - { - ShowCaption = false; - InstructionalText = 'An inspection should be created for an assembly order when these filters match. You can choose other fields on the last step.'; - Visible = (StepWhichAssemblyOrderCounter = CurrentStepCounter); - - field(ChoosechooseAssemblyLocation; LocationCodeFilter) - { - ApplicationArea = All; - Caption = 'Location'; - ToolTip = 'Specifies a location filter'; - - trigger OnAssistEdit() - begin - QltyFilterHelpers.AssistEditLocation(LocationCodeFilter); - end; - - trigger OnValidate() - begin - if not UpdateFullTextRuleStringsFromFilters() then - Error(LocationFilterErr, GetLastErrorText()); - end; - } - field(ToBinCodeFilter; ToBinCodeFilter) - { - ApplicationArea = All; - Caption = 'To Bin'; - ToolTip = 'Specifies a destination bin.'; - - trigger OnAssistEdit() - begin - QltyFilterHelpers.AssistEditBin(LocationCodeFilter, '', ToBinCodeFilter); - end; - - trigger OnValidate() - begin - if not UpdateFullTextRuleStringsFromFilters() then - Error(ToBinFilterErr, GetLastErrorText()); - end; - } - field(ChooseAssemblyDescriptionPattern; DescriptionPattern) - { - ApplicationArea = All; - Caption = 'Description'; - ToolTip = 'Specifies a filter for description'; - - trigger OnValidate() - begin - UpdateFullTextRuleStringsFromFilters(); - end; - } - field(ChooseAdvancedAssembly; 'Click here to choose advanced fields...') - { - ApplicationArea = All; - ShowCaption = false; - - trigger OnDrillDown() - begin - UpdateFullTextRuleStringsFromFilters(); - AssistEditFullPostedAssemblyHeaderFilter(); - UpdateTableVariablesFromRecordFilters(); - end; - } - } - group(SettingsFor_StepWhichItem) + group(SettingsFor_iStepWhichItem) { Caption = ' '; ShowCaption = false; @@ -404,7 +306,6 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" } group(SettingsForWrapProdOrderRoutingLineRule) { - Visible = IsProductionOrder; ShowCaption = false; field(ChooseProdOrderRoutingLineRuleFilter; ProdOrderRoutingLineRuleFilter) @@ -420,24 +321,6 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" end; } } - group(SettingsForWrapAssemblyOrderRule) - { - Visible = IsAssemblyOrder; - ShowCaption = false; - - field(ChoosePostedAssemblyOrderRuleFilter; PostedAssemblyOrderRuleFilter) - { - ApplicationArea = All; - Caption = 'Filters'; - ToolTip = 'Specifies additional filters you may need to review and set.'; - MultiLine = true; - - trigger OnAssistEdit() - begin - AssistEditFullPostedAssemblyHeaderFilter(); - end; - } - } field(ChooseFilters_Item; ItemRuleFilter) { ApplicationArea = All; @@ -450,35 +333,22 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" AssistEditFullItemFilter(); end; } - group(SettingsForbAutomaticallyCreateInspection) + group(SettingsForAutomaticallyCreateInspection) { ShowCaption = false; InstructionalText = 'Do you want to automatically create inspections when these are produced? This will set the activation trigger for this rule and set the default trigger value for inspection generation rules of this record type.'; group(SettingsForAutoProductionTriggerWrapper) { - Visible = IsProductionOrder; ShowCaption = false; - field(ChooseeAutomaticallyCreateProductionInspection; QltyProductionTrigger) + field(ChooseAutomaticallyCreateProductionInspection; QltyProductionTrigger) { ApplicationArea = Manufacturing; Caption = 'Automatically Create Inspection'; ToolTip = 'Specifies whether to automatically create an inspection when product is produced.'; } } - group(SettingsForAutoAssemblyProductionTriggerWrapper) - { - Visible = IsAssemblyOrder; - ShowCaption = false; - - field(ChooseeAutomaticallyCreateAssemblyInspection; QltyAssemblyTrigger) - { - ApplicationArea = All; - Caption = 'Automatically Create Inspection'; - ToolTip = 'Specifies whether to automatically create an inspection when product is produced.'; - } - } } } } @@ -535,7 +405,6 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" TempProdOrderRoutingLine: Record "Prod. Order Routing Line" temporary; TempItem: Record "Item" temporary; TempQltyInspectionGenRule: Record "Qlty. Inspection Gen. Rule" temporary; - TempPostedAssemblyHeader: Record "Posted Assembly Header" temporary; QltyFilterHelpers: Codeunit "Qlty. Filter Helpers"; CurrentStepCounter: Integer; LocationCodeFilter: Code[20]; @@ -551,7 +420,6 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" CategoryCodeFilter: Code[20]; InventoryPostingGroupCode: Code[20]; QltyProductionTrigger: Enum "Qlty. Production Trigger"; - QltyAssemblyTrigger: Enum "Qlty. Assembly Trigger"; ProdOrderRoutingLineRuleFilter: Text[400]; PostedAssemblyOrderRuleFilter: Text[400]; ItemRuleFilter: Text[400]; @@ -560,13 +428,9 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" IsFinishEnabledd: Boolean; IsMovingForward: Boolean; IsMovingBackward: Boolean; - IsAssemblyOrder: Boolean; - IsProductionOrder: Boolean; StepWhichTemplateCounter: Integer; StepWhichLineCounter: Integer; StepWhichItemFilterCounter: Integer; - StepAssemblyOrProductionCounter: Integer; - StepWhichAssemblyOrderCounter: Integer; StepDoneCounter: Integer; MaxStep: Integer; LocationFilterErr: Label 'This Location filter needs an adjustment. Location codes are no more than 10 characters. %1', Comment = '%1 = Text of the original error message'; @@ -587,11 +451,9 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" begin QltyManagementSetup.Get(); StepWhichTemplateCounter := 1; - StepAssemblyOrProductionCounter := 2; - StepWhichLineCounter := 3; - StepWhichAssemblyOrderCounter := 4; - StepWhichItemFilterCounter := 5; - StepDoneCounter := 6; + StepWhichLineCounter := 2; + StepWhichItemFilterCounter := 3; + StepDoneCounter := 4; InitializeDefaultValues(); @@ -610,8 +472,6 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" local procedure InitializeDefaultValues() begin InitializeDefaultTemplate(); - if not IsProductionOrder and not IsAssemblyOrder then - IsProductionOrder := true; end; local procedure InitializeDefaultTemplate() @@ -641,9 +501,6 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" if IsMovingForward then LeavingStepMovingForward(CurrentStepCounter, Step); - if IsMovingBackward then - LeavingStepMovingBackward(CurrentStepCounter, Step); - case Step of StepWhichTemplateCounter: begin @@ -651,24 +508,12 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" IsNextEnabledd := true; IsFinishEnabledd := false; end; - StepAssemblyOrProductionCounter: - begin - IsBackEnabledd := true; - IsNextEnabledd := true; - IsFinishEnabledd := false; - end; StepWhichLineCounter: begin IsBackEnabledd := true; IsNextEnabledd := true; IsFinishEnabledd := false; end; - StepWhichAssemblyOrderCounter: - begin - IsBackEnabledd := true; - IsNextEnabledd := true; - IsFinishEnabledd := false; - end; StepWhichItemFilterCounter: begin IsBackEnabledd := true; @@ -694,34 +539,17 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" QltyInspectionTemplateHdr: Record "Qlty. Inspection Template Hdr."; begin if LeavingThisStep = StepWhichTemplateCounter then - if MovingToThisStep = StepAssemblyOrProductionCounter then + if MovingToThisStep = StepWhichLineCounter then begin if not QltyInspectionTemplateHdr.Get(TemplateCode) then begin Message(YouMustChooseATemplateFirstMsg); MovingToThisStep := StepWhichTemplateCounter; end; - if LeavingThisStep = StepAssemblyOrProductionCounter then - if IsProductionOrder then begin - MovingToThisStep := StepWhichLineCounter; QltyProductionTrigger := QltyManagementSetup."Production Trigger"; - end else begin - MovingToThisStep := StepWhichAssemblyOrderCounter; - QltyAssemblyTrigger := QltyManagementSetup."Assembly Trigger"; end; if LeavingThisStep = StepWhichLineCounter then MovingToThisStep := StepWhichItemFilterCounter; end; - local procedure LeavingStepMovingBackward(LeavingThisStep: Integer; var MovingToThisStep: Integer) - begin - if LeavingThisStep = StepWhichItemFilterCounter then - if IsProductionOrder then - MovingToThisStep := StepWhichLineCounter - else - MovingToThisStep := StepWhichAssemblyOrderCounter; - if LeavingThisStep = StepWhichAssemblyOrderCounter then - MovingToThisStep := StepAssemblyOrProductionCounter; - end; - local procedure AssistEditFullProdOrderRoutingLineFilter() begin TempQltyInspectionGenRule."Source Table No." := Database::"Prod. Order Routing Line"; @@ -748,26 +576,9 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" end; end; - local procedure AssistEditFullPostedAssemblyHeaderFilter() - begin - TempQltyInspectionGenRule."Source Table No." := Database::"Posted Assembly Header"; - TempQltyInspectionGenRule."Condition Filter" := PostedAssemblyOrderRuleFilter; - - if TempQltyInspectionGenRule.AssistEditConditionTableFilter() then begin - PostedAssemblyOrderRuleFilter := TempQltyInspectionGenRule."Condition Filter"; - - TempPostedAssemblyHeader.SetView(PostedAssemblyOrderRuleFilter); - UpdateTableVariablesFromRecordFilters(); - CleanUpWhereClause(); - end; - end; - local procedure CleanUpWhereClause() begin - if IsProductionOrder then - ProdOrderRoutingLineRuleFilter := QltyFilterHelpers.CleanUpWhereClause400(ProdOrderRoutingLineRuleFilter); - if IsAssemblyOrder then - PostedAssemblyOrderRuleFilter := QltyFilterHelpers.CleanUpWhereClause400(PostedAssemblyOrderRuleFilter); + ProdOrderRoutingLineRuleFilter := QltyFilterHelpers.CleanUpWhereClause400(ProdOrderRoutingLineRuleFilter); ItemRuleFilter := QltyFilterHelpers.CleanUpWhereClause400(ItemRuleFilter); end; @@ -797,22 +608,13 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" end; QltyInspectionGenRule.Validate("Template Code", TemplateCode); QltyManagementSetup.Get(); - if IsProductionOrder then begin - QltyInspectionGenRule."Source Table No." := Database::"Prod. Order Routing Line"; - QltyInspectionGenRule.Intent := QltyInspectionGenRule.Intent::Production; - QltyInspectionGenRule."Condition Filter" := ProdOrderRoutingLineRuleFilter; - QltyInspectionGenRule.SetIntentAndDefaultTriggerValuesFromSetup(); - QltyInspectionGenRule."Production Trigger" := QltyProductionTrigger; - - QltyManagementSetup."Production Trigger" := QltyProductionTrigger; - end else begin - QltyInspectionGenRule."Source Table No." := Database::"Posted Assembly Header"; - QltyInspectionGenRule.Intent := QltyInspectionGenRule.Intent::Assembly; - QltyInspectionGenRule."Condition Filter" := PostedAssemblyOrderRuleFilter; - QltyInspectionGenRule.SetIntentAndDefaultTriggerValuesFromSetup(); - QltyInspectionGenRule."Assembly Trigger" := QltyAssemblyTrigger; - QltyManagementSetup."Assembly Trigger" := QltyAssemblyTrigger; - end; + QltyInspectionGenRule."Source Table No." := Database::"Prod. Order Routing Line"; + QltyInspectionGenRule.Intent := QltyInspectionGenRule.Intent::Production; + QltyInspectionGenRule."Condition Filter" := ProdOrderRoutingLineRuleFilter; + QltyInspectionGenRule.SetIntentAndDefaultTriggerValuesFromSetup(); + QltyInspectionGenRule."Production Trigger" := QltyProductionTrigger; + + QltyManagementSetup."Production Trigger" := QltyProductionTrigger; if QltyManagementSetup.Modify(false) then; QltyInspectionGenRule."Item Filter" := ItemRuleFilter; QltyInspectionGenRule.Modify(); @@ -839,19 +641,10 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" begin TempQltyInspectionGenRule := QltyInspectionGenRule; Clear(TempProdOrderRoutingLine); - Clear(TempPostedAssemblyHeader); Clear(TempItem); - if QltyInspectionGenRule."Source Table No." = Database::"Prod. Order Routing Line" then begin + if QltyInspectionGenRule."Source Table No." = Database::"Prod. Order Routing Line" then TempProdOrderRoutingLine.SetView(TempQltyInspectionGenRule."Condition Filter"); - IsProductionOrder := true; - IsAssemblyOrder := false; - end; - if QltyInspectionGenRule."Source Table No." = Database::"Posted Assembly Header" then begin - TempPostedAssemblyHeader.SetView(TempQltyInspectionGenRule."Condition Filter"); - IsAssemblyOrder := true; - IsProductionOrder := false; - end; TempItem.SetView(TempQltyInspectionGenRule."Item Filter"); UpdateTableVariablesFromRecordFilters(); @@ -865,21 +658,15 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" [TryFunction] local procedure UpdateFullTextRuleStringsFromFilters() begin - if IsProductionOrder then begin - TempProdOrderRoutingLine.SetFilter("Location Code", LocationCodeFilter); - TempProdOrderRoutingLine.SetFilter("Routing No.", RoutingNoFilter); - TempProdOrderRoutingLine.SetFilter("Work Center No.", WorkCenterNo); - TempProdOrderRoutingLine.SetFilter("No.", SpecificNoFilter); - TempProdOrderRoutingLine.SetFilter("From-Production Bin Code", FromBinCodeFilter); - TempProdOrderRoutingLine.SetFilter("To-Production Bin Code", ToBinCodeFilter); - TempProdOrderRoutingLine.SetFilter("Operation No.", OperationNo); - TempProdOrderRoutingLine.SetFilter("Description", DescriptionPattern); - ProdOrderRoutingLineRuleFilter := CopyStr(QltyFilterHelpers.CleanUpWhereClause400(TempProdOrderRoutingLine.GetView(true)), 1, MaxStrLen(TempQltyInspectionGenRule."Condition Filter")); - end else begin - TempPostedAssemblyHeader.SetFilter("Location Code", LocationCodeFilter); - TempPostedAssemblyHeader.SetFilter(Description, DescriptionPattern); - PostedAssemblyOrderRuleFilter := CopyStr(QltyFilterHelpers.CleanUpWhereClause400(TempPostedAssemblyHeader.GetView(true)), 1, MaxStrLen(TempQltyInspectionGenRule."Condition Filter")); - end; + TempProdOrderRoutingLine.SetFilter("Location Code", LocationCodeFilter); + TempProdOrderRoutingLine.SetFilter("Routing No.", RoutingNoFilter); + TempProdOrderRoutingLine.SetFilter("Work Center No.", WorkCenterNo); + TempProdOrderRoutingLine.SetFilter("No.", SpecificNoFilter); + TempProdOrderRoutingLine.SetFilter("From-Production Bin Code", FromBinCodeFilter); + TempProdOrderRoutingLine.SetFilter("To-Production Bin Code", ToBinCodeFilter); + TempProdOrderRoutingLine.SetFilter("Operation No.", OperationNo); + TempProdOrderRoutingLine.SetFilter("Description", DescriptionPattern); + ProdOrderRoutingLineRuleFilter := CopyStr(QltyFilterHelpers.CleanUpWhereClause400(TempProdOrderRoutingLine.GetView(true)), 1, MaxStrLen(TempQltyInspectionGenRule."Condition Filter")); TempItem.SetFilter("No.", ItemNoFilter); TempItem.SetFilter("Item Category Code", CategoryCodeFilter); @@ -891,29 +678,20 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" if StrLen(QltyFilterHelpers.CleanUpWhereClause400(TempProdOrderRoutingLine.GetView(true))) > MaxStrLen(TempQltyInspectionGenRule."Condition Filter") then Error(FilterLengthErr, MaxStrLen(TempQltyInspectionGenRule."Condition Filter")); - if StrLen(QltyFilterHelpers.CleanUpWhereClause400(TempPostedAssemblyHeader.GetView(true))) > MaxStrLen(TempQltyInspectionGenRule."Condition Filter") then - Error(FilterLengthErr, MaxStrLen(TempQltyInspectionGenRule."Condition Filter")); - if StrLen(QltyFilterHelpers.CleanUpWhereClause400(TempItem.GetView(true))) > MaxStrLen(TempQltyInspectionGenRule."Item Filter") then Error(FilterLengthErr, MaxStrLen(TempQltyInspectionGenRule."Item Filter")); end; local procedure UpdateTableVariablesFromRecordFilters() begin - if IsProductionOrder then begin - LocationCodeFilter := CopyStr(TempProdOrderRoutingLine.GetFilter("Location Code"), 1, MaxStrLen(LocationCodeFilter)); - RoutingNoFilter := CopyStr(TempProdOrderRoutingLine.GetFilter("Routing No."), 1, MaxStrLen(RoutingNoFilter)); - WorkCenterNo := CopyStr(TempProdOrderRoutingLine.GetFilter("Work Center No."), 1, MaxStrLen(WorkCenterNo)); - SpecificNoFilter := CopyStr(TempProdOrderRoutingLine.GetFilter("No."), 1, MaxStrLen(SpecificNoFilter)); - FromBinCodeFilter := CopyStr(TempProdOrderRoutingLine.GetFilter("From-Production Bin Code"), 1, MaxStrLen(FromBinCodeFilter)); - ToBinCodeFilter := CopyStr(TempProdOrderRoutingLine.GetFilter("To-Production Bin Code"), 1, MaxStrLen(ToBinCodeFilter)); - OperationNo := CopyStr(TempProdOrderRoutingLine.GetFilter("Operation No."), 1, MaxStrLen(OperationNo)); - DescriptionPattern := CopyStr(TempProdOrderRoutingLine.GetFilter("Description"), 1, MaxStrLen(DescriptionPattern)); - end else begin - LocationCodeFilter := CopyStr(TempPostedAssemblyHeader.GetFilter("Location Code"), 1, MaxStrLen(LocationCodeFilter)); - DescriptionPattern := CopyStr(TempPostedAssemblyHeader.GetFilter(Description), 1, MaxStrLen(DescriptionPattern)); - ToBinCodeFilter := CopyStr(TempPostedAssemblyHeader.GetFilter("Bin Code"), 1, MaxStrLen(ToBinCodeFilter)); - end; + LocationCodeFilter := CopyStr(TempProdOrderRoutingLine.GetFilter("Location Code"), 1, MaxStrLen(LocationCodeFilter)); + RoutingNoFilter := CopyStr(TempProdOrderRoutingLine.GetFilter("Routing No."), 1, MaxStrLen(RoutingNoFilter)); + WorkCenterNo := CopyStr(TempProdOrderRoutingLine.GetFilter("Work Center No."), 1, MaxStrLen(WorkCenterNo)); + SpecificNoFilter := CopyStr(TempProdOrderRoutingLine.GetFilter("No."), 1, MaxStrLen(SpecificNoFilter)); + FromBinCodeFilter := CopyStr(TempProdOrderRoutingLine.GetFilter("From-Production Bin Code"), 1, MaxStrLen(FromBinCodeFilter)); + ToBinCodeFilter := CopyStr(TempProdOrderRoutingLine.GetFilter("To-Production Bin Code"), 1, MaxStrLen(ToBinCodeFilter)); + OperationNo := CopyStr(TempProdOrderRoutingLine.GetFilter("Operation No."), 1, MaxStrLen(OperationNo)); + DescriptionPattern := CopyStr(TempProdOrderRoutingLine.GetFilter("Description"), 1, MaxStrLen(DescriptionPattern)); ItemNoFilter := CopyStr(TempItem.GetFilter("No."), 1, MaxStrLen(ItemNoFilter)); CategoryCodeFilter := CopyStr(TempItem.GetFilter("Item Category Code"), 1, MaxStrLen(CategoryCodeFilter)); diff --git a/src/Apps/W1/Quality Management/app/src/Permissions/QltyEntryInspector.PermissionSet.al b/src/Apps/W1/Quality Management/app/src/Permissions/QltyEntryInspector.PermissionSet.al index ab330f9fce..2bc47bcef0 100644 --- a/src/Apps/W1/Quality Management/app/src/Permissions/QltyEntryInspector.PermissionSet.al +++ b/src/Apps/W1/Quality Management/app/src/Permissions/QltyEntryInspector.PermissionSet.al @@ -110,6 +110,7 @@ permissionset 20404 QltyEntryInspector page "Qlty. Management Setup" = X, page "Qlty. Most Recent Picture" = X, page "Qlty. Prod. Gen. Rule Wizard" = X, + page "Qlty. Asm. Gen. Rule Wizard" = X, page "Qlty. Rec. Gen. Rule Wizard" = X, page "Qlty. Related Transfer Orders" = X, page "Qlty. Report Selection - QM" = X, diff --git a/src/Apps/W1/Quality Management/app/src/Permissions/QltyGeneral.PermissionSet.al b/src/Apps/W1/Quality Management/app/src/Permissions/QltyGeneral.PermissionSet.al index b762870411..3e0ce1f90f 100644 --- a/src/Apps/W1/Quality Management/app/src/Permissions/QltyGeneral.PermissionSet.al +++ b/src/Apps/W1/Quality Management/app/src/Permissions/QltyGeneral.PermissionSet.al @@ -108,6 +108,7 @@ permissionset 20403 QltyGeneral page "Qlty. Management Setup" = X, page "Qlty. Most Recent Picture" = X, page "Qlty. Prod. Gen. Rule Wizard" = X, + page "Qlty. Asm. Gen. Rule Wizard" = X, page "Qlty. Rec. Gen. Rule Wizard" = X, page "Qlty. Related Transfer Orders" = X, page "Qlty. Report Selection - QM" = X, diff --git a/src/Apps/W1/Quality Management/app/src/Permissions/QltyMngmntObjects.PermissionSet.al b/src/Apps/W1/Quality Management/app/src/Permissions/QltyMngmntObjects.PermissionSet.al index e8d63b3b1d..294ec224e3 100644 --- a/src/Apps/W1/Quality Management/app/src/Permissions/QltyMngmntObjects.PermissionSet.al +++ b/src/Apps/W1/Quality Management/app/src/Permissions/QltyMngmntObjects.PermissionSet.al @@ -106,6 +106,7 @@ permissionset 20406 "QltyMngmnt - Objects" page "Qlty. Management Setup" = X, page "Qlty. Most Recent Picture" = X, page "Qlty. Prod. Gen. Rule Wizard" = X, + page "Qlty. Asm. Gen. Rule Wizard" = X, page "Qlty. Rec. Gen. Rule Wizard" = X, page "Qlty. Related Transfer Orders" = X, page "Qlty. Report Selection - QM" = X, diff --git a/src/Apps/W1/Quality Management/app/src/Setup/QltyManagementSetup.Page.al b/src/Apps/W1/Quality Management/app/src/Setup/QltyManagementSetup.Page.al index 984a2fa7c0..7553112e91 100644 --- a/src/Apps/W1/Quality Management/app/src/Setup/QltyManagementSetup.Page.al +++ b/src/Apps/W1/Quality Management/app/src/Setup/QltyManagementSetup.Page.al @@ -184,66 +184,74 @@ page 20400 "Qlty. Management Setup" } } } + group(SettingsForAssembly) + { + Caption = 'Assembly'; + field("Assembly Trigger"; Rec."Assembly Trigger") + { + Caption = 'Assembly - Create Inspection'; + ApplicationArea = Assembly; + ShowCaption = true; + AboutTitle = 'Assembly related trigger'; + AboutText = 'Optionally choose an assembly-related trigger to try and create an inspection.'; + } + field(ChooseCreateNewRule_Assembly; 'Click here to create a new generation rule...') + { + ShowCaption = false; + ApplicationArea = Assembly; + + trigger OnDrillDown() + var + QltyAsmGenRuleWizard: Page "Qlty. Asm. Gen. Rule Wizard"; + begin + CurrPage.Update(true); + QltyAsmGenRuleWizard.RunModal(); + CurrPage.Update(false); + end; + } + } group(SettingsForProduction) { Caption = 'Production'; - InstructionalText = 'Production related settings are configured in this group. For example, you can choose to automatically create inspections when output is created.'; - - group(SettingsForProductionAutomation) + field("Production Trigger"; Rec."Production Trigger") { - Caption = 'Automation'; - InstructionalText = 'Define the default automation settings for inspection generation rules related to production output. Different triggers can be changed on the inspection generation rules.'; - AboutTitle = 'Production Related Automation Settings'; - AboutText = 'Production related settings are configured in this group. You can choose to automatically create inspections when output is created, whether or not to update the source, and other automatic features.'; - - field("Production Trigger"; Rec."Production Trigger") - { - Caption = 'Production - Create Inspection'; - ApplicationArea = Manufacturing; - ShowCaption = true; - AboutTitle = 'Production related trigger'; - AboutText = 'Optionally choose a production-related trigger to try and create an inspection.'; - } - field("Auto Output Configuration"; Rec."Auto Output Configuration") - { - Caption = 'Auto Output Configuration'; - ApplicationArea = Manufacturing; - ShowCaption = true; - AboutTitle = 'Auto Output Configuration'; - AboutText = 'Provides granular options for when an inspection should be created automatically during the production process.'; - } - field("Assembly Trigger"; Rec."Assembly Trigger") - { - Caption = 'Assembly - Create Inspection'; - ApplicationArea = Assembly; - ShowCaption = true; - AboutTitle = 'Assembly related trigger'; - AboutText = 'Optionally choose an assembly-related trigger to try and create an inspection.'; - } - field(ChooseCreateNewRule_Production; 'Click here to create a new generation rule...') - { - ShowCaption = false; - ApplicationArea = Assembly, Manufacturing; + Caption = 'Production - Create Inspection'; + ApplicationArea = Manufacturing; + ShowCaption = true; + AboutTitle = 'Production related trigger'; + AboutText = 'Optionally choose a production-related trigger to try and create an inspection.'; + } + field("Auto Output Configuration"; Rec."Auto Output Configuration") + { + Caption = 'Auto Output Configuration'; + ApplicationArea = Manufacturing; + ShowCaption = true; + AboutTitle = 'Auto Output Configuration'; + AboutText = 'Provides granular options for when an inspection should be created automatically during the production process.'; + } + field(ChooseCreateNewRule_Production; 'Click here to create a new generation rule...') + { + ShowCaption = false; + ApplicationArea = Manufacturing; - trigger OnDrillDown() - var - QltyProdGenRuleWizard: Page "Qlty. Prod. Gen. Rule Wizard"; - begin - CurrPage.Update(true); - QltyProdGenRuleWizard.RunModal(); - CurrPage.Update(false); - end; - } - field("Production Update Control"; Rec."Production Update Control") - { - ApplicationArea = Manufacturing; - ShowCaption = true; - Caption = 'Control Source'; - Importance = Additional; - Visible = false; - AboutTitle = 'When to update on production related changes.'; - AboutText = 'Set to "Update when Source Changes" to alter source information as the source record changes (for example, such as when a Production Order changes status to Finished). Set to "Do Not Update" to prevent updating the original source that created the inspection.'; - } + trigger OnDrillDown() + var + QltyProdGenRuleWizard: Page "Qlty. Prod. Gen. Rule Wizard"; + begin + CurrPage.Update(true); + QltyProdGenRuleWizard.RunModal(); + CurrPage.Update(false); + end; + } + field("Production Update Control"; Rec."Production Update Control") + { + ApplicationArea = Manufacturing; + ShowCaption = true; + Caption = 'Control Source'; + Importance = Additional; + Visible = false; + AboutTitle = 'When to update on production related changes.'; + AboutText = 'Set to "Update when Source Changes" to alter source information as the source record changes (for example, such as when a Production Order changes status to Finished). Set to "Do Not Update" to prevent updating the original source that created the inspection.'; } } group(SettingsForInventory)