{"title":"Codeunit 20404 Qlty. Inspection - Create, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/20404-qlty-inspection-create/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-10-05","object":{"type":"codeunit","id":20404,"name":"Qlty. Inspection - Create","app":"Quality Management","url":"https://jonas-paprotka.de/ref/codeunit/20404-qlty-inspection-create/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/20404-qlty-inspection-create/source/","path":"src/Apps/W1/Quality Management/app/src/Document/QltyInspectionCreate.Codeunit.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"codeunit:20599":{"name":"Qlty. Misc Helpers","url":"https://jonas-paprotka.de/ref/codeunit/20599-qlty-misc-helpers/"},"table:20400":{"name":"Qlty. Management Setup","url":"https://jonas-paprotka.de/ref/table/20400-qlty-management-setup/"},"codeunit:20406":{"name":"Qlty. Permission Mgmt.","url":"https://jonas-paprotka.de/ref/codeunit/20406-qlty-permission-mgmt/"},"codeunit:20408":{"name":"Qlty. Traversal","url":"https://jonas-paprotka.de/ref/codeunit/20408-qlty-traversal/"},"codeunit:20405":{"name":"Qlty. Inspec. Gen. Rule Mgmt.","url":"https://jonas-paprotka.de/ref/codeunit/20405-qlty-inspec-gen-rule-mgmt/"},"table:20405":{"name":"Qlty. Inspection Header","url":"https://jonas-paprotka.de/ref/table/20405-qlty-inspection-header/"},"table:20406":{"name":"Qlty. Inspection Line","url":"https://jonas-paprotka.de/ref/table/20406-qlty-inspection-line/"},"codeunit:20426":{"name":"Qlty. Start Workflow","url":"https://jonas-paprotka.de/ref/codeunit/20426-qlty-start-workflow/"},"codeunit:20437":{"name":"Qlty. Notification Mgmt.","url":"https://jonas-paprotka.de/ref/codeunit/20437-qlty-notification-mgmt/"},"codeunit:701":{"name":"Data Type Management","url":"https://jonas-paprotka.de/ref/codeunit/701-data-type-management/"},"codeunit:20409":{"name":"Qlty. Result Condition Mgmt.","url":"https://jonas-paprotka.de/ref/codeunit/20409-qlty-result-condition-mgmt/"},"codeunit:20410":{"name":"Qlty. Result Evaluation","url":"https://jonas-paprotka.de/ref/codeunit/20410-qlty-result-evaluation/"},"codeunit:20404":{"name":"Qlty. Inspection - Create","url":"https://jonas-paprotka.de/ref/codeunit/20404-qlty-inspection-create/"},"codeunit:20428":{"name":"Qlty. Item Tracking","url":"https://jonas-paprotka.de/ref/codeunit/20428-qlty-item-tracking/"},"codeunit:99000845":{"name":"Reservation Management","url":"https://jonas-paprotka.de/ref/codeunit/99000845-reservation-management/"},"table:336":{"name":"Tracking Specification","url":"https://jonas-paprotka.de/ref/table/336-tracking-specification/"}},"procs":[{"name":"CreateInspectionWithVariant","line":71,"kind":"procedure","access":"internal","params":2,"steps":[[73,"call","CreateInspectionWithVariantAndTemplate",3]]},{"name":"CreateInspectionWithVariantAndTemplate","line":91,"kind":"procedure","access":"internal","params":3,"steps":[[97,"call","InternalCreateInspectionWithVariantAndTemplate",6]]},{"name":"InternalCreateInspectionWithVariantAndTemplate","line":112,"kind":"procedure","access":"local","params":6,"steps":[[121,"ext","codeunit",20599,"GetRecordRefFromVariant",2],[124,"call","InternalCreateInspectionWithSpecificTemplate",7]]},{"name":"InternalCreateInspectionWithGenerationRule","line":137,"kind":"procedure","access":"local","params":6,"steps":[[145,"ext","codeunit",20599,"GetRecordRefFromVariant",2],[148,"call","InternalCreateInspectionWithSpecificTemplate",7]]},{"name":"CreateInspectionWithMultiVariants","line":174,"kind":"procedure","access":"internal","params":6,"steps":[[187,"call","InternalCreateInspectionWithGenerationRule",6],[189,"call","InternalCreateInspectionWithGenerationRule",6],[191,"call","InternalCreateInspectionWithGenerationRule",6],[195,"call","InternalCreateInspectionWithGenerationRule",6],[199,"call","GetCreatedInspection",1]]},{"name":"CreateInspectionWithMultiVariantsAndTemplate","line":216,"kind":"procedure","access":"internal","params":6,"steps":[[229,"call","InternalCreateInspectionWithVariantAndTemplate",6],[231,"call","InternalCreateInspectionWithVariantAndTemplate",6],[233,"call","InternalCreateInspectionWithVariantAndTemplate",6],[237,"call","InternalCreateInspectionWithVariantAndTemplate",6],[241,"call","GetCreatedInspection",1]]},{"name":"CreateInspection","line":257,"kind":"procedure","access":"internal","params":2,"steps":[[263,"call","InternalCreateInspectionWithVariantAndTemplate",6]]},{"name":"CreateInspectionWithSpecificTemplate","line":278,"kind":"procedure","access":"internal","params":3,"steps":[[283,"call","InternalCreateInspectionWithSpecificTemplate",5]]},{"name":"InternalCreateInspectionWithSpecificTemplate","line":316,"kind":"procedure","access":"local","params":7,"steps":[[337,"ext","table",20400,"GetSetupRecord",0],[346,"ext","codeunit",20406,"VerifyCanCreateManualInspection",0],[353,"event","OnBeforeCreateInspection",1],[360,"ext","codeunit",20408,"FindRelatedItem",5],[362,"ext","codeunit",20405,"FindMatchingGenerationRule",6],[378,"ext","codeunit",20408,"ApplySourceFields",4],[379,"call","ApplyAllSourceFieldsToStub",5],[381,"call","ApplyAllSourceFieldsToStub",5],[383,"call","GetExistingOrCreateNewInspectionFor",6],[384,"ext","table",20405,"SetIsCreating",1],[386,"event","OnAfterCreateInspectionBeforeDialog",0],[392,"write",20405,"Modify"],[395,"ext","table",20405,"UpdateResultFromLines",0],[397,"ext","table",20405,"SetIsCreating",1],[398,"write",20405,"Modify"],[404,"ext","table",20406,"UpdateExpressionsInOtherInspectionLinesInSameInspection",0],[407,"ext","table",20405,"SetIsCreating",1],[412,"ext","codeunit",20426,"StartWorkflowInspectionCreated",1],[419,"call","TryRunInspectionPage",2],[420,"ext","codeunit",20437,"NotifyInspectionCreated",1],[423,"ext","codeunit",20437,"NotifyInspectionCreated",1],[426,"call","LogCreateInspectionProblem",3],[431,"event","OnAfterCreateInspectionAfterDialog",0]]},{"name":"FindExistingInspectionWithVariant","line":457,"kind":"procedure","access":"internal","params":3,"steps":[[463,"call","FindExistingInspectionWithMultipleVariants",6]]},{"name":"FindExistingInspectionWithMultipleVariants","line":476,"kind":"procedure","access":"internal","params":6,"steps":[[485,"ext","codeunit",20599,"GetRecordRefFromVariant",2],[488,"ext","codeunit",701,"GetRecordRef",2],[489,"ext","codeunit",701,"GetRecordRef",2],[490,"ext","codeunit",701,"GetRecordRef",2],[491,"call","FindExistingInspection",6]]},{"name":"FindExistingInspection","line":504,"kind":"procedure","access":"internal","params":6,"steps":[[511,"event","OnBeforeFindExistingInspection",1],[515,"ext","codeunit",20408,"FindRelatedItem",5],[516,"ext","codeunit",20405,"FindMatchingGenerationRule",5],[517,"call","LogCreateInspectionProblem",3]]},{"name":"GetExistingOrCreateNewInspectionFor","line":565,"kind":"procedure","access":"local","params":6,"steps":[[580,"call","FindExistingInspectionWithStub",4],[617,"event","OnCustomCreateInspectionBehavior",0],[622,"ext","table",20405,"SetIsCreating",1],[624,"call","InitReinspectionHeader",2],[627,"validate",20405,"Template Code"],[634,"ext","table",20405,"SetIsCreating",1],[637,"ext","codeunit",20408,"ApplySourceFields",4],[639,"ext","codeunit",20408,"ApplySourceFields",4],[644,"write",20405,"Insert",1],[646,"call","CreateQualityInspectionResultLinesFromTemplate",1]]},{"name":"CreateQualityInspectionResultLinesFromTemplate","line":661,"kind":"procedure","access":"local","params":1,"steps":[[679,"validate",20406,"Test Code"],[683,"write",20406,"Insert"],[684,"ext","codeunit",20409,"CopyResultConditionsFromTemplateToInspection",2],[685,"ext","table",20405,"SetPreventAutoAssignment",1],[693,"ext","codeunit",20410,"TryValidateQltyInspectionLine",2],[694,"write",20406,"Modify",1],[695,"write",20405,"Modify",1],[699,"ext","table",20405,"SetPreventAutoAssignment",1]]},{"name":"FindExistingInspectionWithVariant","line":713,"kind":"procedure","access":"internal","params":7,"steps":[[720,"ext","codeunit",701,"GetRecordRef",2],[721,"ext","codeunit",701,"GetRecordRef",2],[722,"ext","codeunit",701,"GetRecordRef",2],[723,"call","FindExistingInspection",7]]},{"name":"FindExistingInspection","line":737,"kind":"procedure","access":"internal","params":7,"steps":[[745,"call","ApplyAllSourceFieldsToStub",5],[747,"call","FindExistingInspectionWithStub",4]]},{"name":"CreateReinspection","line":804,"kind":"procedure","access":"internal","params":2,"steps":[[811,"event","OnBeforeCreateReinspection",1],[821,"write",20405,"Modify"],[824,"call","InitReinspectionHeader",2],[825,"write",20405,"Insert",1],[826,"call","CreateQualityInspectionResultLinesFromTemplate",1],[830,"event","OnAfterCreateReinspection",0]]},{"name":"InitReinspectionHeader","line":838,"kind":"procedure","access":"local","params":2,"steps":[[843,"validate",20405,"Template Code"],[848,"validate",20405,"Result Code"]]},{"name":"CreateMultipleInspectionsForMarkedTrackingSpecification","line":920,"kind":"procedure","access":"internal","params":2,"steps":[[936,"call","CreateMultipleInspectionsForMultipleRecords",3]]},{"name":"CreateMultipleInspectionsForMultipleRecords","line":957,"kind":"procedure","access":"internal","params":3,"steps":[[962,"call","CreateMultipleInspectionsWithoutDisplaying",5],[967,"call","DisplayInspectionsIfConfigured",2],[972,"call","DisplayInspectionsIfConfigured",2]]},{"name":"DisplayInspectionsIfConfigured","line":982,"kind":"procedure","access":"internal","params":2,"steps":[[1007,"ext","codeunit",20437,"NotifyMultipleInspectionsCreatedByCount",1],[1016,"call","TryRunInspectionPage",2],[1017,"ext","codeunit",20437,"NotifyInspectionCreated",1],[1019,"ext","codeunit",20437,"NotifyInspectionCreated",1],[1023,"call","TryRunInspectionPage",2],[1024,"ext","codeunit",20437,"NotifyMultipleInspectionsCreated",1],[1026,"ext","codeunit",20437,"NotifyMultipleInspectionsCreated",1]]},{"name":"CreateMultipleInspectionsWithoutDisplaying","line":1039,"kind":"procedure","access":"internal","params":5,"steps":[[1055,"call","CreateInspectionForSelfOrDirectParent",7]]},{"name":"CreateInspectionForSelfOrDirectParent","line":1087,"kind":"procedure","access":"local","params":7,"steps":[[1098,"ext","codeunit",20404,"SetPreventDisplayingInspectionEvenIfConfigured",1],[1101,"ext","codeunit",20408,"FindSingleParentRecord",2],[1116,"ext","codeunit",20408,"FindRelatedItem",5],[1118,"ext","codeunit",20405,"DoesMatchItemAttributeFiltersOrNoFilter",2],[1121,"ext","codeunit",20428,"IsItemTrackingUsed",1],[1123,"ext","codeunit",99000845,"SetReservSource",1],[1152,"write",336,"DeleteAll"],[1153,"ext","table",336,"SetSourceFromReservEntry",1],[1154,"ext","table",336,"CopyTrackingFromReservEntry",1],[1155,"write",336,"Insert"],[1159,"ext","codeunit",20404,"CreateInspectionWithMultiVariants",6],[1160,"call","TrackResolvedInspection",3],[1165,"ext","codeunit",20408,"FindRelatedItem",5],[1169,"ext","codeunit",20404,"CreateInspectionWithMultiVariants",6],[1170,"call","TrackResolvedInspection",3]]},{"name":"TrackResolvedInspection","line":1184,"kind":"procedure","access":"local","params":3,"steps":[[1188,"ext","codeunit",20404,"GetCreatedInspection",1],[1194,"ext","codeunit",20404,"IsLastInspectionNewlyCreated",0]]},{"name":"ApplyAllSourceFieldsToStub","line":1217,"kind":"procedure","access":"local","params":5,"steps":[[1224,"ext","codeunit",701,"GetRecordRef",2],[1225,"ext","codeunit",701,"GetRecordRef",2],[1226,"ext","codeunit",701,"GetRecordRef",2],[1231,"ext","codeunit",20408,"ApplySourceFields",4],[1236,"ext","codeunit",20408,"ApplySourceFields",4],[1241,"ext","codeunit",20408,"ApplySourceFields",4],[1246,"ext","codeunit",20408,"ApplySourceFields",4]]}]}