Codeunit 444 "Purchase-Post Prepayments"
Base Application · Microsoft.Purchases.Posting
Across versions
- BC23present
- BC244 events added
- BC25unchanged
- BC264 events added, 2 procedures added
- BC27unchanged
- BC282 events added, 1 events removed
- BC293 events added
- BC301 events added
Neighbourhood 22 connected objects and pages
Base Application · Microsoft.Purchases.Posting · BC23-30 · source at ea08af5e · facts from BC29
Properties
| Property | Value |
|---|---|
| TableNo | Purchase Header |
| Permissions | TableData “Purchase Line” = rimd, TableData “G/L Register” = rimd, TableData “Vendor Posting Group” = rimd, TableData “Inventory Posting Group” = rimd, TableData “Purch. Inv. Header” = rimd, TableData “Purch. Inv. Line” = rimd, TableData “Purch. Cr. Memo Hdr.” = rimd, TableData “Purch. Cr. Memo Line… |
Events published
OnAfterCreateDimensionsProcedure(var PurchaseLine: Record "Purchase Line"; DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])(integration)OnAfterApplyFilter(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; DocumentType: Option)(integration)OnAfterCalcVATAmountLines(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; DocumentType: Option Invoice,"Credit Memo",Statistic)(integration)OnAfterCheckPrepmtDoc(PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo"; var ErrorMessageMgt: Codeunit "Error Message Management")(integration)- subscribers: Codeunit 5579 “Digital Voucher Impl.” OnAfterCheckPurchPrepmtDoc
OnAfterCreateLinesOnBeforeGLPosting(var PurchaseHeader: Record "Purchase Header"; PurchInvHeader: Record "Purch. Inv. Header"; PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var TempPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary; DocumentType: Option; var LastLineNo: Integer)(integration)- subscribers: Codeunit 6784 “Wthldg Tax Purch. Subscribers” VendorPrepaymentInvoiceWithholdingTax
OnAfterFillInvLineBuffer(var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; PurchLine: Record "Purchase Line"; CommitIsSuppressed: Boolean; PurchaseHeader: Record "Purchase Header")(integration)OnAfterInsertInvoiceRounding(PurchaseHeader: Record "Purchase Header"; var PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var PrevLineNo: Integer)(integration)OnAfterPostPrepayments(var PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo"; CommitIsSuppressed: Boolean; var PurchInvHeader: Record "Purch. Inv. Header"; var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.")(integration)- subscribers: Codeunit 5579 “Digital Voucher Impl.” CheckPurchVoucherOnAfterPostPrepayments
OnAfterPostBalancingEntry(var GenJnlLine: Record "Gen. Journal Line"; VendLedgEntry: Record "Vendor Ledger Entry"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)(integration)OnAfterPostVendorEntry(var GenJnlLine: Record "Gen. Journal Line"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)(integration)OnAfterPostPrepmtInvLineBuffer(var GenJnlLine: Record "Gen. Journal Line"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSuppressed: Boolean; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")(integration)OnAfterPurchInvHeaderInsert(var PurchInvHeader: Record "Purch. Inv. Header"; PurchHeader: Record "Purchase Header"; CommitIsSupressed: Boolean)(integration)OnAfterPurchInvLineInsert(var PurchInvLine: Record "Purch. Inv. Line"; PurchInvHeader: Record "Purch. Inv. Header"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)(integration)OnAfterPurchCrMemoHeaderInsert(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; PurchHeader: Record "Purchase Header"; CommitIsSupressed: Boolean)(integration)OnAfterPurchCrMemoLineInsert(var PurchCrMemoLine: Record "Purch. Cr. Memo Line"; PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)(integration)OnAfterRoundAmounts(PurchaseHeader: Record "Purchase Header"; var PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBufLCY: Record "Prepayment Inv. Line Buffer")(integration)OnAfterUpdatePostedPurchDocument(DocumentType: Option Invoice,"Credit Memo"; DocumentNo: Code[20]; CommitIsSuppressed: Boolean)(integration)OnAfterUpdateVATOnLines(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; VATAmountLine: Record "VAT Amount Line"; DocumentType: Option Invoice,"Credit Memo",Statistic)(integration)OnBeforeCheckPrepmtDoc(PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo")(integration)OnBeforeInvoice(var PurchaseHeader: Record "Purchase Header"; var Handled: Boolean)(integration)OnBeforeCreditMemo(var PurchaseHeader: Record "Purchase Header"; var Handled: Boolean)(integration)OnBeforeCreateLinesFromBuffer(var PurchHeader: Record "Purchase Header"; var TempGlobalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer" temporary; var LineCount: Integer; var Window: Dialog; var PurchInvHeader: Record "Purch. Inv. Header"; var PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var PostedDocTabNo: Integer; var IsHandled: Boolean; DocumentType: Option; var LastLineNo: Integer)(integration)OnBeforePostPrepayments(var PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo"; CommitIsSuppressed: Boolean)(integration)OnBeforePostVendorEntryProcedure(var PurchHeader: Record "Purchase Header"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; DocumentType: Option Invoice,"Credit Memo"; PostingDescription: Text[100]; DocType: Enum "Gen. Journal Document Type"; DocNo: Code[20]; ExtDocNo: Text[35]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20]; CalcPmtDisc: Boolean; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var IsHandled: Boolean)(integration)OnBeforePurchaseAssertPrepmtAmountNotMoreThanDocAmount(var VendLedgEntry: Record "Vendor Ledger Entry"; PurchHeader: Record "Purchase Header"; PurchLine: Record "Purchase Line"; var IsHandled: Boolean)(integration)OnBeforePurchInvHeaderInsert(var PurchInvHeader: Record "Purch. Inv. Header"; PurchHeader: Record "Purchase Header"; CommitIsSupressed: Boolean)(integration)OnBeforePurchInvLineInsert(var PurchInvLine: Record "Purch. Inv. Line"; PurchInvHeader: Record "Purch. Inv. Header"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)(integration)OnBeforePurchCrMemoHeaderInsert(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; PurchHeader: Record "Purchase Header"; CommitIsSupressed: Boolean)(integration)OnBeforePurchCrMemoLineInsert(var PurchCrMemoLine: Record "Purch. Cr. Memo Line"; PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)(integration)OnBeforePostBalancingEntry(var GenJnlLine: Record "Gen. Journal Line"; VendLedgEntry: Record "Vendor Ledger Entry"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)(integration)- subscribers: Codeunit 6784 “Wthldg Tax Purch. Subscribers” OnBeforePostBalancingEntry
OnBeforePostVendorEntry(var GenJnlLine: Record "Gen. Journal Line"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean; PurchaseHeader: Record "Purchase Header"; DocumentType: Option)(integration)- subscribers: Codeunit 6784 “Wthldg Tax Purch. Subscribers” OnBeforePostVendorEntry
OnBeforePostPrepmtInvLineBuffer(var GenJnlLine: Record "Gen. Journal Line"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)(integration)- subscribers: Codeunit 6784 “Wthldg Tax Purch. Subscribers” PostPrepmtInvLineBuffer
OnBeforeRunGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line")(integration)OnBeforeSetStatusPendingPrepayment(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)(integration)OnBeforeUpdateDocNos(var PurchaseHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo"; var DocNo: Code[20]; var NoSeriesCode: Code[20]; var ModifyHeader: Boolean; var PreviewMode: Boolean; var IsHandled: Boolean)(integration)OnBeforeUpdatePostedPurchaseDocument(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var PurchInvHeader: Record "Purch. Inv. Header"; var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; DocumentType: Option Invoice,"Credit Memo"; var IsHandled: Boolean; DocumentNo: Code[20])(integration)OnCodeOnBeforePostBalancingEntry(var PurchaseHeader: Record "Purchase Header"; var TempPrepaymentInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary)(integration)OnCodeOnBeforePostVendorEntry(var PurchaseHeader: Record "Purchase Header"; var TempPrepaymentInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary)(integration)OnPostVendorEntryOnAfterInitNewLine(var GenJnlLine: Record "Gen. Journal Line"; PurchHeader: Record "Purchase Header")(integration)OnRoundAmountsOnBeforeIncrAmoutns(PurchaseHeader: Record "Purchase Header"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBufLCY: Record "Prepayment Inv. Line Buffer")(integration)OnUpdatePurchaseDocumentOnBeforeFindSetCrMemoPurchLine(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line")+ BC28 (integration)OnUpdatePurchaseDocumentOnBeforeModifyCrMemoPurchLine(var PurchaseLine: Record "Purchase Line")(integration)OnUpdatePurchaseDocumentOnBeforeModifyInvoicePurchLine(var PurchaseLine: Record "Purchase Line")(integration)OnUpdateVATOnLinesOnAfterGetRemainder(var VATAmountLineRemainder: Record "VAT Amount Line"; var RemainderExists: Boolean)(integration)OnUpdateVATOnLinesOnAfterVATAmountLineGet(var VATAmountLine: Record "VAT Amount Line")(integration)OnUpdateVATOnLinesOnBeforePurchLineModify(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var TempVATAmountLineRemainder: Record "VAT Amount Line"; NewAmount: Decimal; NewAmountIncludingVAT: Decimal; NewVATBaseAmount: Decimal)(integration)OnCodeOnBeforeWindowOpen(var PurchaseHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo")(integration)OnFillInvLineBufferOnAfterInit(var PrepaymentInvLineBuffer: Record "Prepayment Inv. Line Buffer"; PurchaseHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line")(integration)OnCodeOnAfterUpdateHeaderAndLines(var PurchaseHeader: Record "Purchase Header"; var PurchInvHeader: Record "Purch. Inv. Header"; var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; DocumentType: Option Invoice,"Credit Memo"; PreviewMode: Boolean)+ BC28 − BC28 (integration)- subscribers: Codeunit 6784 “Wthldg Tax Purch. Subscribers” VendorPrepaymentCrMemoWithholdingTax
OnBeforeUpdatePrepmtAmountOnPurchLines(PurchaseHeader: Record "Purchase Header"; NewTotalPrepmtAmount: Decimal; var IsHandled: Boolean)(integration)OnUpdatePrepmtAmountOnPurchLinesOnAfterSetFilters(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; var NewTotalPrepaymentAmount: Decimal)+ BC29 (integration)OnUpdatePrepmtAmountOnPurchLinesOnBeforeErrorIfLinesNotFound(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; var RaiseError: Boolean)+ BC29 (integration)OnUpdatePrepmtAmountOnPurchLinesOnBeforeModify(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; var NewTotalPrepaymentAmount: Decimal; var TotalPrepaymentAmount: Decimal)+ BC29 (integration)OnBeforeUpdateCrMemoDocNos(var PurchaseHeader: Record "Purchase Header")(integration)OnAfterUpdateCrMemoDocNos(var PurchaseHeader: Record "Purchase Header")(integration)OnBeforeInsertExtendedText(TabNo: Integer; DocNo: Code[20]; GLAccNo: Code[20]; DocDate: Date; LanguageCode: Code[10]; var PrevLineNo: Integer; var IsHandled: Boolean)(integration)OnBeforeGetPurchLines(PurchaseHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo",Statistic; var ToPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)+ BC24 (integration)OnBeforeCheckOpenPrepaymentLines(var PurchaseHeader: Record "Purchase Header"; DocumentType: Option)+ BC24 (integration)OnAfterCheckOpenPrepaymentLines(var PurchaseHeader: Record "Purchase Header"; DocumentType: Option; var Found: Boolean)+ BC24 (integration)OnInsertVATAmountOnBeforeInsert(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line")+ BC26 (integration)OnFindVATAmountLineOnAfterSetFilters(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line")+ BC26 (integration)OnBuildInvLineBufferOnPrepmtAmountZero(PurchaseHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line"; var PrepaymentInvLineBuffer2: Record "Prepayment Inv. Line Buffer"; var PrepaymentInvLineBuffer: Record "Prepayment Inv. Line Buffer"; var TempPurchaseLineSource: Record "Purchase Line" temporary)+ BC24 (integration)OnCreateDimensionsOnAfterAddDimSources(var PurchaseLine: Record "Purchase Line"; DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])+ BC26 (integration)- subscribers: Codeunit 99000789 “Mfg. Purchase Document Mgt.” OnCreateDimensionsOnAfterAddDimSources
OnAfterGetPrepmtAccNo(GenPostingSetup: Record "General Posting Setup"; var PrepmtAccNo: Code[20])+ BC26 (integration)
Procedures
SetDocumentType(DocumentType: Option ,,Invoice,"Credit Memo")Invoice(var PurchHeader: Record "Purchase Header")CreditMemo(var PurchHeader: Record "Purchase Header")CheckPrepmtDoc(PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo")CheckOpenPrepaymentLines(PurchHeader: Record "Purchase Header"; DocumentType: Option): BooleanGetCorrBalAccNo(PurchHeader: Record "Purchase Header"; PositiveAmount: Boolean): Code[20]GetInvRoundingAccNo(VendorPostingGroup: Code[20]): Code[20]UpdateVATOnLines(PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; DocumentType: Option Invoice,"Credit Memo",Statistic)CalcVATAmountLines(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; DocumentType: Option Invoice,"Credit Memo",Statistic)SumPrepmt(PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; var TotalAmount: Decimal; var TotalVATAmount: Decimal; var VATAmountText: Text[30])GetPurchLines(PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo",Statistic; var ToPurchLine: Record "Purchase Line")BuildInvLineBuffer(PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; DocumentType: Option Invoice,"Credit Memo",Statistic; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer")FillInvLineBuffer(PurchHeader: Record "Purchase Header"; PurchLine: Record "Purchase Line"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer")PrepmtAmount(PurchLine: Record "Purchase Line"; DocumentType: Option Invoice,"Credit Memo",Statistic): DecimalUpdatePrepmtAmountOnPurchLines(PurchHeader: Record "Purchase Header"; NewTotalPrepmtAmount: Decimal)GetPurchLinesToDeduct(PurchHeader: Record "Purchase Header"; var PurchLines: Record "Purchase Line")GetPreviewMode(): BooleanGetSuppressCommit(): BooleanSetSuppressCommit(NewSuppressCommit: Boolean)SetPreviewMode(NewPreviewMode: Boolean)
Plus 41 local procedures.
Triggers
OnRun
Relations
- runs on Table 38 “Purchase Header”
Calls
From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an Object::"Name" argument. Interface dispatch and calls through events are not counted, so the list is not complete.
- Codeunit 28 “Error Message Management” (11 calls:
BuildInvLineBuffer → FinishTopContext,CheckPrepmtDoc → Finish,CheckPrepmtDoc → GetFieldNo, …) - Codeunit 12 “Gen. Jnl.-Post Line” (3 calls:
PostBalancingEntry → RunWithCheck,PostVendorEntry → RunWithCheck,RunGenJnlPostLine → RunWithCheck) - Codeunit 408 “DimensionManagement” (2 calls:
CreateDimensions → AddDimSource,CreateDimensions → GetRecDefaultDimID) - Codeunit 8703 “Feature Telemetry” (2 calls:
Code → LogUptake,Code → LogUsage) - Page 456 “No. Series” (2 calls:
UpdateCrMemoDocNos → (object),UpdateInvoiceDocNos → (object)) - Codeunit 11 “Gen. Jnl.-Check Line” (1 call:
CheckPrepmtDoc → DateNotAllowed) - Codeunit 1431 “Forward Link Mgt.” (1 call:
CheckPrepmtDoc → GetHelpCodeForAllowedPostingDate) - Codeunit 19 “Gen. Jnl.-Post Preview” (1 call:
Code → ThrowError) - Codeunit 378 “Transfer Extended Text” (1 call:
InsertExtendedText → PrepmtGetAnyExtText) - Codeunit 441 “Prepayment Mgt.” (1 call:
PurchaseAssertPrepmtAmountNotMoreThanDocAmount → AssertPrepmtAmountNotMoreThanDocAmount) - Codeunit 481 “Check Dimensions” (1 call:
CheckPrepmtDoc → CheckPurchPrepmtDim) - Codeunit 9070 “Document Errors Mgt.” (1 call:
CheckPrepmtDoc → GetNothingToPostErrorMsg) - Codeunit 9500 “Sequence No. Mgt.” (1 call:
OnRun → SetPreviewMode)
Called by
- Codeunit 445 “Purch.-Post Prepmt. (Yes/No)” (5 calls:
OnRunPreview → (object),OnRunPreview → SetDocumentType,OnRunPreview → SetPreviewMode, …) - Page 403 “Purchase Order Statistics” (5 calls:
RefreshOnAfterGetRecord → GetPurchLines,RefreshOnAfterGetRecord → SumPrepmt,UpdatePrepmtAmount → GetPurchLines, …) - Codeunit 816 “Purch. Post Invoice” (2 calls:
PrepareLine → GetCorrBalAccNo,PrepareLine → GetInvRoundingAccNo) - Codeunit 6785 “Withholding Tax Mgmt.” (1 call:
InsertVendPrepaymentInvoiceWithholding → PrepmtAmount) - Table 39 “Purchase Line” (1 call:
GetLineAmountToHandleInclPrepmt → PrepmtAmount)
Recent changes
- 2026-09-17 #10898 [Extensibility Request] issue 30434: add purchase prepayment amount event (main, BC30, feature)
- 2026-08-27 #10172 [Extensibility Request] issue 30111: add purchase prepayment update events (main, BC30, feature)
- 2026-08-12 #10124 [Extensibility Request] issue 30400: add credit memo line filter event (main, BC30, feature)
Countries that replace it
Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).
Ask your agent
Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: bcatlas_resolve_node(object_type: "codeunit", object_name: "Purchase-Post Prepayments"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.