{"title":"Codeunit 131904 Library - Time Sheet, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/131904-library-time-sheet/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":131904,"name":"Library - Time Sheet","app":"Application Test Library","url":"https://jonas-paprotka.de/ref/codeunit/131904-library-time-sheet/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/131904-library-time-sheet/source/","path":"src/Layers/W1/Tests/ApplicationTestLibrary/LibraryTimeSheet.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":{"table:314":{"name":"Resources Setup","url":"https://jonas-paprotka.de/ref/table/314-resources-setup/"},"codeunit:131305":{"name":"Library - ERM Country Data","url":"https://jonas-paprotka.de/ref/codeunit/131305-library-erm-country-data/"},"codeunit:130000":{"name":"Assert","url":"https://jonas-paprotka.de/ref/codeunit/130000-assert/"},"codeunit:131902":{"name":"Library - Service","url":"https://jonas-paprotka.de/ref/codeunit/131902-library-service/"},"table:210":{"name":"Job Journal Line","url":"https://jonas-paprotka.de/ref/table/210-job-journal-line/"},"codeunit:131000":{"name":"Library - Utility","url":"https://jonas-paprotka.de/ref/codeunit/131000-library-utility/"},"table:1003":{"name":"Job Planning Line","url":"https://jonas-paprotka.de/ref/table/1003-job-planning-line/"},"table:156":{"name":"Resource","url":"https://jonas-paprotka.de/ref/table/156-resource/"},"report:950":{"name":"Create Time Sheets","url":"https://jonas-paprotka.de/ref/report/950-create-time-sheets/"},"table:950":{"name":"Time Sheet Header","url":"https://jonas-paprotka.de/ref/table/950-time-sheet-header/"},"table:951":{"name":"Time Sheet Line","url":"https://jonas-paprotka.de/ref/table/951-time-sheet-line/"},"table:952":{"name":"Time Sheet Detail","url":"https://jonas-paprotka.de/ref/table/952-time-sheet-detail/"},"codeunit:131300":{"name":"Library - ERM","url":"https://jonas-paprotka.de/ref/codeunit/131300-library-erm/"},"codeunit:130511":{"name":"Library - Resource","url":"https://jonas-paprotka.de/ref/codeunit/130511-library-resource/"},"table:91":{"name":"User Setup","url":"https://jonas-paprotka.de/ref/table/91-user-setup/"},"table:200":{"name":"Work Type","url":"https://jonas-paprotka.de/ref/table/200-work-type/"},"codeunit:132201":{"name":"Library - Inventory","url":"https://jonas-paprotka.de/ref/codeunit/132201-library-inventory/"},"table:5220":{"name":"Human Resource Unit of Measure","url":"https://jonas-paprotka.de/ref/table/5220-human-resource-unit-of-measure/"},"table:5206":{"name":"Cause of Absence","url":"https://jonas-paprotka.de/ref/table/5206-cause-of-absence/"},"table:50":{"name":"Accounting Period","url":"https://jonas-paprotka.de/ref/table/50-accounting-period/"},"codeunit:130440":{"name":"Library - Random","url":"https://jonas-paprotka.de/ref/codeunit/130440-library-random/"},"table:308":{"name":"No. Series","url":"https://jonas-paprotka.de/ref/table/308-no-series/"},"codeunit:132204":{"name":"Library - Warehouse","url":"https://jonas-paprotka.de/ref/codeunit/132204-library-warehouse/"},"table:83":{"name":"Item Journal Line","url":"https://jonas-paprotka.de/ref/table/83-item-journal-line/"},"codeunit:132207":{"name":"Library - Assembly","url":"https://jonas-paprotka.de/ref/codeunit/132207-library-assembly/"},"table:900":{"name":"Assembly Header","url":"https://jonas-paprotka.de/ref/table/900-assembly-header/"},"codeunit:951":{"name":"Time Sheet Approval Management","url":"https://jonas-paprotka.de/ref/codeunit/951-time-sheet-approval-management/"},"report:952":{"name":"Suggest Job Jnl. Lines","url":"https://jonas-paprotka.de/ref/report/952-suggest-job-jnl-lines/"},"codeunit:950":{"name":"Time Sheet Management","url":"https://jonas-paprotka.de/ref/codeunit/950-time-sheet-management/"}},"procs":[{"name":"Initialize","line":28,"kind":"procedure","params":0,"steps":[[37,"write",314,"Insert"],[41,"validate",314,"Time Sheet Nos."],[41,"call","GetTimeSheetNoSeries",0],[42,"write",314,"Modify"],[46,"ext","codeunit",131305,"CreateVATData",0]]},{"name":"CheckAssemblyTimeSheetLine","line":51,"kind":"procedure","params":4,"steps":[[61,"ext","codeunit",130000,"AreEqual",3],[63,"ext","codeunit",130000,"IsTrue",2],[64,"ext","codeunit",130000,"AreEqual",3],[66,"ext","codeunit",130000,"IsTrue",2]]},{"name":"CheckServiceTimeSheetLine","line":71,"kind":"procedure","params":5,"steps":[[75,"ext","codeunit",131902,"CheckServiceTimeSheetLine",5]]},{"name":"CreateJobJournalLine","line":79,"kind":"procedure","params":3,"steps":[[84,"validate",210,"Journal Template Name"],[85,"validate",210,"Journal Batch Name"],[87,"validate",210,"Line No."],[87,"ext","codeunit",131000,"GetNewLineNo",2],[88,"write",210,"Insert",1]]},{"name":"CreateJobPlanningLine","line":91,"kind":"procedure","params":5,"steps":[[107,"write",1003,"Insert"]]},{"name":"CreateTimeSheet","line":110,"kind":"procedure","params":2,"steps":[[121,"call","CreateUserSetup",2],[124,"call","CreateTimeSheetResource",1],[125,"validate",156,"Time Sheet Owner User ID"],[126,"validate",156,"Time Sheet Approver User ID"],[127,"write",156,"Modify"],[130,"call","GetAccountingPeriod",1],[141,"ext","report",950,"InitParameters",5],[142,"ext","report",950,"UseRequestPage",1]]},{"name":"CreateTimeSheetLine","line":150,"kind":"procedure","params":7,"steps":[[154,"ext","table",950,"GetLastLineNo",0],[163,"validate",951,"Job No."],[164,"validate",951,"Job Task No."],[167,"validate",951,"Service Order No."],[169,"validate",951,"Cause of Absence Code"],[171,"write",951,"Insert",1]]},{"name":"CreateTimeSheetDetail","line":174,"kind":"procedure","params":3,"steps":[[182,"ext","table",952,"CopyFromTimeSheetLine",1],[184,"write",952,"Insert"]]},{"name":"CreateTimeSheetResource","line":187,"kind":"procedure","params":1,"steps":[[193,"ext","codeunit",131300,"FindVATPostingSetup",2],[194,"ext","codeunit",130511,"CreateResource",2],[196,"call","FindHRUnitOfMeasure",1],[198,"ext","codeunit",130511,"CreateResourceUnitOfMeasure",4],[200,"validate",156,"Base Unit of Measure"],[202,"write",156,"Modify"]]},{"name":"CreateServiceOrder","line":207,"kind":"procedure","params":2,"steps":[[211,"ext","codeunit",131902,"CreateServiceOrder",2]]},{"name":"CreateUserSetup","line":215,"kind":"procedure","params":2,"steps":[[224,"ext","codeunit",131000,"GenerateRandomCode",2],[225,"write",91,"Insert"]]},{"name":"CreateWorkType","line":228,"kind":"procedure","params":2,"steps":[[231,"validate",200,"Code"],[232,"write",200,"Insert",1],[233,"validate",200,"Description"],[234,"validate",200,"Unit of Measure Code"],[235,"write",200,"Modify"]]},{"name":"CreateHRUnitOfMeasure","line":238,"kind":"procedure","params":2,"steps":[[242,"ext","codeunit",132201,"CreateUnitOfMeasureCode",1],[244,"validate",5220,"Code"],[245,"validate",5220,"Qty. per Unit of Measure"],[246,"write",5220,"Insert",1]]},{"name":"CreateCauseOfAbsence","line":249,"kind":"procedure","params":1,"steps":[[253,"call","CreateHRUnitOfMeasure",2],[256,"validate",5206,"Code"],[256,"ext","codeunit",131000,"GenerateGUID",0],[257,"validate",5206,"Description"],[257,"ext","codeunit",131000,"GenerateGUID",0],[258,"validate",5206,"Unit of Measure Code"],[259,"write",5206,"Insert",1]]},{"name":"FindCauseOfAbsence","line":262,"kind":"procedure","params":1,"steps":[[269,"validate",5206,"Unit of Measure Code"],[270,"write",5206,"Modify",1]]},{"name":"GetAccountingPeriod","line":304,"kind":"procedure","params":1,"steps":[[319,"write",50,"Insert"]]},{"name":"GetRandomDecimal","line":323,"kind":"procedure","params":0,"steps":[[325,"ext","codeunit",130440,"RandInt",1]]},{"name":"GetTimeSheetNoSeries","line":328,"kind":"procedure","params":0,"steps":[[334,"ext","codeunit",131000,"CreateNoSeries",4],[335,"write",308,"Rename"],[336,"ext","codeunit",131000,"CreateNoSeriesLine",4]]},{"name":"GetTimeSheetLineBuffer","line":343,"kind":"procedure","params":1,"steps":[[348,"write",951,"Insert"]]},{"name":"InitAssemblyBackwayScenario","line":352,"kind":"procedure","params":4,"steps":[[368,"call","CreateTimeSheet",2],[374,"call","CreateUserSetup",2],[375,"call","CreateTimeSheetResource",1],[376,"validate",156,"Time Sheet Owner User ID"],[377,"validate",156,"Time Sheet Approver User ID"],[380,"ext","codeunit",131300,"FindGeneralPostingSetupInvtFull",1],[381,"validate",156,"Gen. Prod. Posting Group"],[382,"write",156,"Modify"],[384,"ext","codeunit",132204,"CreateLocationWithInventoryPostingSetup",1],[387,"ext","codeunit",132201,"SelectItemJournalTemplateName",2],[388,"ext","codeunit",132201,"SelectItemJournalBatchName",3],[389,"ext","codeunit",132201,"ClearItemJournal",2],[392,"ext","codeunit",132201,"CreateItem",1],[393,"ext","codeunit",132201,"CreateItemJournalLine",6],[395,"validate",83,"Location Code"],[396,"write",83,"Modify"],[399,"ext","codeunit",132201,"PostItemJournalLine",2],[402,"ext","codeunit",132201,"CreateBOMComponent",6],[405,"ext","codeunit",132207,"CreateAssemblyHeader",6],[406,"validate",900,"Posting Date"],[407,"write",900,"Modify"],[408,"ext","codeunit",132207,"CreateAssemblyLine",8]]},{"name":"InitBackwayScenario","line":414,"kind":"procedure","params":3,"steps":[[418,"ext","codeunit",131902,"InitBackwayScenario",3]]},{"name":"InitJobScenario","line":422,"kind":"procedure","params":2,"steps":[[429,"call","CreateTimeSheet",2],[433,"call","FindJob",1],[434,"call","FindJobTask",2],[438,"write",156,"Modify"],[439,"call","CreateTimeSheetLine",7],[443,"call","CreateTimeSheetDetail",3],[443,"call","GetRandomDecimal",0],[445,"ext","codeunit",951,"Submit",1],[446,"ext","codeunit",951,"Approve",1]]},{"name":"InitResourceScenario","line":449,"kind":"procedure","params":3,"steps":[[452,"call","CreateTimeSheet",2],[455,"call","CreateTimeSheetLine",7],[457,"write",951,"Modify"],[460,"call","CreateTimeSheetDetail",3],[460,"call","GetRandomDecimal",0],[462,"ext","codeunit",951,"Submit",1],[463,"ext","codeunit",951,"Approve",1]]},{"name":"InitScenarioWTForJob","line":466,"kind":"procedure","params":1,"steps":[[476,"call","CreateTimeSheet",2],[481,"call","FindJob",1],[482,"call","FindJobTask",2],[486,"write",156,"Modify"],[487,"call","CreateTimeSheetLine",7],[493,"call","CreateWorkType",2],[498,"call","CreateTimeSheetDetail",3],[498,"call","GetRandomDecimal",0],[499,"call","CreateTimeSheetDetail",3],[499,"call","GetRandomDecimal",0],[500,"ext","codeunit",951,"Submit",1]]},{"name":"InitScenarioWTForServiceOrder","line":506,"kind":"procedure","params":2,"steps":[[510,"ext","codeunit",131902,"InitScenarioWTForServiceOrder",2]]},{"name":"InitServiceScenario","line":516,"kind":"procedure","params":3,"steps":[[520,"ext","codeunit",131902,"InitServiceScenario",3]]},{"name":"SubmitTimeSheetLine","line":524,"kind":"procedure","params":1,"steps":[[526,"ext","codeunit",951,"Submit",1]]},{"name":"SubmitAndApproveTimeSheetLine","line":529,"kind":"procedure","params":1,"steps":[[531,"ext","codeunit",951,"Submit",1],[532,"ext","codeunit",951,"Approve",1]]},{"name":"RunSuggestJobJnlLinesReportForResourceInPeriod","line":535,"kind":"procedure","params":4,"steps":[[541,"ext","report",952,"InitParameters",6]]},{"name":"RunCreateTimeSheetsReport","line":545,"kind":"procedure","params":3,"steps":[[550,"ext","report",950,"InitParameters",5],[551,"ext","report",950,"UseRequestPage",1]]},{"name":"OnAfterProcessManagerTimeSheet","line":556,"kind":"procedure","access":"local","params":2,"steps":[[560,"ext","codeunit",950,"CopyFilteredTimeSheetLinesToBuffer",2]]},{"name":"OnAfterProcessManagerTimeSheetByJob","line":564,"kind":"procedure","access":"local","params":2,"steps":[[568,"ext","codeunit",950,"CopyFilteredTimeSheetLinesToBuffer",2]]}]}