{"title":"Codeunit 8066 Purchase Documents, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/8066-purchase-documents/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":8066,"name":"Purchase Documents","app":"Subscription Billing","url":"https://jonas-paprotka.de/ref/codeunit/8066-purchase-documents/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/8066-purchase-documents/source/","path":"src/Apps/W1/Subscription Billing/App/Billing/Codeunits/PurchaseDocuments.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:8061":{"name":"Billing Line","url":"https://jonas-paprotka.de/ref/table/8061-billing-line/"},"table:8064":{"name":"Billing Line Archive","url":"https://jonas-paprotka.de/ref/table/8064-billing-line-archive/"},"table:8006":{"name":"Usage Data Billing","url":"https://jonas-paprotka.de/ref/table/8006-usage-data-billing/"}},"procs":[{"name":"PurchaseHeaderOnBeforeDeleteEvent","line":15,"kind":"procedure","access":"local","params":2,"steps":[[33,"call","ResetServiceCommitmentAndDeleteBillingLinesForPurchaseLine",1],[36,"call","AutoResetServiceCommitmentAndDeleteBillingLinesForPurchaseInvoice",1],[41,"call","ResetServiceCommitmentAndDeleteAllBillingLinesForDocument",1],[46,"call","ResetPurchaseDocumentFieldsForBillingLines",1]]},{"name":"PurchaseLineOnAfterDeleteEvent","line":51,"kind":"procedure","access":"local","params":2,"steps":[[70,"call","ResetServiceCommitmentAndDeleteBillingLinesForPurchaseLine",1],[72,"call","AutoResetServiceCommitmentAndDeleteBillingLinesForPurchaseInvoice",1],[73,"call","ResetServiceCommitmentAndDeleteAllBillingLinesForDocument",1],[75,"call","FilterBillingLinePerPurchaseLine",2],[76,"call","ResetPurchaseDocumentFieldsForBillingLines",1]]},{"name":"ResetServiceCommitmentAndDeleteBillingLinesForPurchaseLine","line":80,"kind":"procedure","access":"local","params":1,"steps":[[84,"call","FilterBillingLinePerPurchaseLine",2],[86,"ext","table",8061,"FindFirstBillingLineForServiceCommitment",1],[87,"ext","table",8061,"ResetServiceCommitmentNextBillingDate",0],[88,"write",8061,"DeleteAll"]]},{"name":"FilterBillingLinePerPurchaseLine","line":92,"kind":"procedure","access":"local","params":2,"steps":[[94,"ext","table",8061,"FilterBillingLineOnDocumentLine",3],[94,"ext","table",8061,"GetBillingDocumentTypeFromPurchaseDocumentType",1]]},{"name":"ResetPurchaseDocumentFieldsForBillingLines","line":97,"kind":"procedure","access":"local","params":1,"steps":[[100,"write",8061,"ModifyAll"],[102,"write",8061,"ModifyAll"],[103,"write",8061,"ModifyAll"]]},{"name":"PurchasePostOnBeforePurchaseLineDeleteAll","line":143,"kind":"procedure","access":"local","params":3,"steps":[[157,"call","FilterBillingLinePerPurchaseLine",2],[158,"call","MoveBillingLineToBillingLineArchive",4],[159,"write",8061,"DeleteAll"]]},{"name":"MoveBillingLineToBillingLineArchive","line":163,"kind":"procedure","access":"local","params":4,"steps":[[181,"write",8064,"Insert"],[183,"write",8006,"ModifyAll"],[184,"event","OnAfterInsertBillingLineArchiveOnMoveBillingLineToBillingLineArchive",0]]},{"name":"ResetServiceCommitmentAndDeleteAllBillingLinesForDocument","line":199,"kind":"procedure","access":"local","params":1,"steps":[[203,"call","FilterBillingLinePerPurchaseLine",2],[205,"ext","table",8061,"ResetServiceCommitmentNextBillingDate",0],[206,"write",8061,"DeleteAll"]]},{"name":"TransferRecurringBillingMark","line":211,"kind":"procedure","access":"local","params":2,"steps":[[217,"call","GetRecurringBillingField",2]]},{"name":"IsInvoiceCredited","line":249,"kind":"procedure","access":"internal","params":1,"steps":[[255,"ext","table",8064,"IsInvoiceCredited",2]]},{"name":"PurchInvLineCopyContractNoOnAfterInitFromPurchLine","line":259,"kind":"procedure","access":"local","params":3,"steps":[[263,"ext","table",8061,"FilterBillingLineOnDocumentLine",3],[263,"ext","table",8061,"GetBillingDocumentTypeFromPurchaseDocumentType",1]]},{"name":"PurchCrMemoLineCopyContractNoOnAfterInitFromPurchLine","line":271,"kind":"procedure","access":"local","params":2,"steps":[[275,"ext","table",8061,"FilterBillingLineOnDocumentLine",3],[275,"ext","table",8061,"GetBillingDocumentTypeFromPurchaseDocumentType",1]]}]}