---
id: object/codeunit/6784
type: object
title: Codeunit 6784 "Wthldg Tax Purch. Subscribers"
summary: Codeunit 6784 "Wthldg Tax Purch. Subscribers" in WithholdingTax (Microsoft.WithholdingTax). 1 public procedures, 18 event subscribers. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - withholdingtax
versions:
  introduced: "29"
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 436b9920f5176075db641e60a3df722c31ef48bdf8b0d9378b3c26591f832199
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WthldgTaxPurchSubscribers.Codeunit.al
    title: src/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WthldgTaxPurchSubscribers.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/9865
    - change/bcapps/10058
    - change/bcapps/9650
    - change/bcapps/9515
object_type: codeunit
object_id: 6784
name: Wthldg Tax Purch. Subscribers
namespace: Microsoft.WithholdingTax
app: WithholdingTax
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 26
  events: 0
  subscribers: 18
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 2
  called_by: 0
  implements: 0
---

# Codeunit 6784 "Wthldg Tax Purch. Subscribers"

> Codeunit 6784 "Wthldg Tax Purch. Subscribers" in WithholdingTax (Microsoft.WithholdingTax). 1 public procedures, 18 event subscribers. Introduced in BC29, still in BC30.

WithholdingTax · Microsoft.WithholdingTax · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WthldgTaxPurchSubscribers.Codeunit.al) · facts from BC29

## Event subscriptions

- CopyVendorInfo subscribes to Table "Purchase Header" OnAfterCopyBuyFromVendorFieldsFromVendor
- CopyHeaderInfo subscribes to Table "Purchase Line" OnAfterInitHeaderDefaults
- AssignGLAccValue subscribes to Table "Purchase Line" OnAfterAssignGLAccountValues
- AssignItemValue subscribes to Table "Purchase Line" OnAfterAssignItemValues
- AssignFAValue subscribes to Table "Purchase Line" OnAfterAssignFixedAssetValues
- OnAfterPrepareInvoicePostingBuffer subscribes to Codeunit "Purch. Post Invoice Events" OnAfterPrepareInvoicePostingBuffer
- OnPrepareGenJnlLineOnAfterCopyToGenJnlLine subscribes to Codeunit "Purch. Post Invoice Events" OnPrepareGenJnlLineOnAfterCopyToGenJnlLine
- OnPostLedgerEntryOnBeforeGenJnlPostLine subscribes to Codeunit "Purch. Post Invoice Events" OnPostLedgerEntryOnBeforeGenJnlPostLine
- OnPostBalancingEntryOnAfterInitNewLine subscribes to Codeunit "Purch. Post Invoice Events" OnPostBalancingEntryOnAfterInitNewLine
- OnPrepareLineOnAfterAssignAmounts subscribes to Codeunit "Purch. Post Invoice Events" OnPrepareLineOnAfterAssignAmounts
- OnAfterInitGenJnlLineAmountFieldsFromTotalLines subscribes to Codeunit "Purch. Post Invoice Events" OnAfterInitGenJnlLineAmountFieldsFromTotalLines
- CheckWithholdingApplication subscribes to Codeunit "Purch.-Post" OnCheckAndUpdateOnBeforeSetPostingFlags
- PostPurchWithholdingTax subscribes to Codeunit "Purch.-Post" OnPostInvoiceOnAfterPostLines
- VendorPrepaymentInvoiceWithholdingTax subscribes to Codeunit "Purchase-Post Prepayments" OnAfterCreateLinesOnBeforeGLPosting
- PostPrepmtInvLineBuffer subscribes to Codeunit "Purchase-Post Prepayments" OnBeforePostPrepmtInvLineBuffer
- OnBeforePostVendorEntry subscribes to Codeunit "Purchase-Post Prepayments" OnBeforePostVendorEntry
- OnBeforePostBalancingEntry subscribes to Codeunit "Purchase-Post Prepayments" OnBeforePostBalancingEntry
- VendorPrepaymentCrMemoWithholdingTax subscribes to Codeunit "Purchase-Post Prepayments" OnCodeOnAfterUpdateHeaderAndLines

## Procedures

- `InsertGenJournalWithholding(var PurchHeader: Record "Purchase Header"; var GenJnlLine: Record "Gen. Journal Line"; AccountNo: Code[20]; SrcCode: Code[10]; GenJnlLineDocType: Enum "Gen. Journal Document Type"; GenJnlLineDocNo: Code[20]; GenJnlLineExtDocNo: Code[35]; TotalAmount: Decimal; TotalPurchLineLCY: Record "Purchase Line")`

Plus 7 local procedures.

## 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 6785 "Withholding Tax Mgmt."](../codeunit/6785.md) (9 calls: `CheckWithholdingApplication → CheckApplicationPurchWithholdingTax`, `OnBeforePostBalancingEntry → CheckVendorWithholdingTaxLiable`, `PostPrepmtInvLineBuffer → CheckVendorWithholdingTaxLiable`, …)
- [Codeunit 12 "Gen. Jnl.-Post Line"](../codeunit/12.md) (4 calls: `PostWithholdingTax → (object)`, `PostWithholdingTax → GetGLReg`, `PostWithholdingTax → IncreaseTaxEntryNo`, …)

## Recent changes

- 2026-08-19 [#9865 [Main] - 'Greater Than' Withholding Tax Calculation Rule is not app…](../../changes/bcapps/9865.md) (main, BC30, fix)
- 2026-08-11 [#10058 [Master]-Withholding Tax Posting generates Unbalanced G/L Entries when Multiple Withholding Tax Rates are used on one Purchase Invoice.](../../changes/bcapps/10058.md) (main, BC30, fix)
- 2026-07-22 [#9650 [Master] -Revert Changes- 'Greater Than' Withholding Tax Calculation Rule is not applied correctly in Withholding Tax Posting Setup.](../../changes/bcapps/9650.md) (main, BC30, other)
- 2026-07-20 [#9515 [Master] - 'Greater Than' Withholding Tax Calculation Rule is not applied correctly in Withholding Tax Posting Setup.](../../changes/bcapps/9515.md) (main, BC30, fix)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

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: "Wthldg Tax Purch. Subscribers")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
