---
id: object/codeunit/6786
type: object
title: Codeunit 6786 "Withholding Tax Jnl Subscriber"
summary: Codeunit 6786 "Withholding Tax Jnl Subscriber" in WithholdingTax (Microsoft.WithholdingTax). 9 public procedures, 30 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: 6217eae108c20a20375231ae030c7ef878fd15ab343f8aed1615a0cbd67413c9
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingTaxJnlSubscriber.Codeunit.al
    title: src/Apps/W1/WithholdingTax/app/src/Purchase/Transaction/WithholdingTaxJnlSubscriber.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/9650
    - change/bcapps/9515
    - change/bcapps/9479
object_type: codeunit
object_id: 6786
name: Withholding Tax Jnl Subscriber
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: 55
  events: 0
  subscribers: 30
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 3
  called_by: 0
  implements: 0
---

# Codeunit 6786 "Withholding Tax Jnl Subscriber"

> Codeunit 6786 "Withholding Tax Jnl Subscriber" in WithholdingTax (Microsoft.WithholdingTax). 9 public procedures, 30 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/WithholdingTaxJnlSubscriber.Codeunit.al) · facts from BC29

## Event subscriptions

- DeleteWithholdingTaxEntry subscribes to Table "Gen. Journal Line" OnAfterDeleteEvent
- AssignGLAccValue subscribes to Table "Gen. Journal Line" OnAfterAccountNoOnValidateGetGLAccount
- AssignBalGLAccValue subscribes to Table "Gen. Journal Line" OnAfterAccountNoOnValidateGetGLBalAccount
- AssignVendValue subscribes to Table "Gen. Journal Line" OnAfterAccountNoOnValidateGetVendorAccount
- ClearPostingGroups subscribes to Table "Gen. Journal Line" OnAfterClearPostingGroups
- OnBeforeInitGLEntryForGLAcc subscribes to Codeunit "Gen. Jnl.-Post Line" OnBeforeInitGLEntryForGLAcc
- PostWithholdingTaxforGL subscribes to Codeunit "Gen. Jnl.-Post Line" OnPostGLAccOnBeforeDeferralPosting
- OnPostVendOnAfterInitVendLedgEntry subscribes to Codeunit "Gen. Jnl.-Post Line" OnPostVendOnAfterInitVendLedgEntry
- OnPostVendAfterTempDtldCVLedgEntryBufInit subscribes to Codeunit "Gen. Jnl.-Post Line" OnPostVendAfterTempDtldCVLedgEntryBufInit
- OnAfterInitGLRegister subscribes to Codeunit "Gen. Jnl.-Post Line" OnAfterInitGLRegister
- OnAfterVendLedgEntryInsert subscribes to Codeunit "Gen. Jnl.-Post Line" OnBeforePostingDeferral
- OnPostBankAccOnBeforeInitBankAccLedgEntry subscribes to Codeunit "Gen. Jnl.-Post Line" OnPostBankAccOnBeforeInitBankAccLedgEntry
- OnBeforeBankAccLedgEntryUpdateAmounts subscribes to Codeunit "Gen. Jnl.-Post Line" OnBeforeBankAccLedgEntryUpdateAmounts
- OnPostBankAccOnBeforeCheckLedgEntryInsert subscribes to Codeunit "Gen. Jnl.-Post Line" OnPostBankAccOnBeforeCheckLedgEntryInsert
- OnPostBankAccOnBeforeCreateGLEntryBalAcc subscribes to Codeunit "Gen. Jnl.-Post Line" OnPostBankAccOnBeforeCreateGLEntryBalAcc
- OnBeforeCopyFromCVLedgEntryBuffer subscribes to Codeunit "Gen. Jnl.-Post Line" OnBeforeCopyFromCVLedgEntryBuffer
- OnBeforeUpdateOldVendLedgEntryAmountToApply subscribes to Codeunit "Gen. Jnl.-Post Line" OnBeforeUpdateOldVendLedgEntryAmountToApply
- OnAfterOldVendLedgEntryModify subscribes to Codeunit "Gen. Jnl.-Post Line" OnAfterOldVendLedgEntryModify
- OnVendUnrealizedVATOnBeforeGetUnrealizedVATPart subscribes to Codeunit "Gen. Jnl.-Post Line" OnVendUnrealizedVATOnBeforeGetUnrealizedVATPart
- OnUnapplyVendLedgEntryOnAfterCreateGLEntriesForTotalAmounts subscribes to Codeunit "Gen. Jnl.-Post Line" OnUnapplyVendLedgEntryOnAfterCreateGLEntriesForTotalAmounts
- SetNextTaxEntryNo subscribes to Codeunit "Gen. Jnl.-Post Line" OnStartPostingOnAfterSetNextTaxEntryNo
- SetFromWithholdingEntryNo subscribes to Codeunit "Gen. Jnl.-Post Line" OnAfterInitGLRegister
- OnBeforeUpdateGLReg subscribes to Codeunit "Gen. Jnl.-Post Line" OnBeforeUpdateGLReg
- OnBeforeProcessBalanceOfLines subscribes to Codeunit "Gen. Jnl.-Post Batch" OnBeforeProcessBalanceOfLines
- ProcessBalanceOfLines subscribes to Codeunit "Gen. Jnl.-Post Batch" OnAfterProcessBalanceOfLines
- OnProcessLinesOnAfterProcessICTransaction subscribes to Codeunit "Gen. Jnl.-Post Batch" OnProcessLinesOnAfterPostGenJournalLine
- OnBeforeFindGenJnlLineOnProcessLines subscribes to Codeunit "Gen. Jnl.-Post Batch" OnBeforeFindGenJnlLineOnProcessLines
- OnPostPaymentApplicationsOnAfterPostGenJnlLine subscribes to Codeunit "Bank Acc. Reconciliation Post" OnPostPaymentApplicationsOnAfterPostGenJnlLine
- AssignWHTPostingGroupOnCreatePayment subscribes to Page "Create Payment" OnBeforeUpdateGnlJnlLineDimensionsFromVendorPayment
- OnPostPaymentApplicationsOnBeforeValidateApplyRequirements subscribes to Codeunit "Bank Acc. Reconciliation Post" OnPostPaymentApplicationsOnBeforeValidateApplyRequirements

## Procedures

- `IsVendAcc(GenJnlLine: Record "Gen. Journal Line"): Boolean`
- `PostGLAccWithholdingTax(GenJnlLine: Record "Gen. Journal Line"; WHTAmountLCY: Decimal; sender: Codeunit "Gen. Jnl.-Post Line")`
- `CalcVendWithholdingTax(GenJnlLine: Record "Gen. Journal Line"; var WHTAmountLCY: Decimal; var WHTAmount: Decimal)`
- `ProcessSourceCode(SourceCode: Code[10]; SourceCodeSetup: Record "Source Code Setup"): Boolean`
- `PostVendWithholdingTax(GenJnlLine: Record "Gen. Journal Line"; VendLedgEntry: Record "Vendor Ledger Entry"; WithholdingAmount: Decimal; WithholdingAmountLCY: Decimal; NextTransactionNo: Integer; var NextWHTEntryNo: Integer; sender: Codeunit "Gen. Jnl.-Post Line")`
- `UpdateWithholdingEntryTransaction(DocNo: Code[20]; NextTransactionNo: Integer)`
- `CollectWithholdingTaxAmount(DocNo: Code[20]): Decimal`
- `InsertWHTPostingBufferPosted(var WithholdingTaxEntryGL: Record "Withholding Tax Entry"; var GenJnlLine: Record "Gen. Journal Line"; Apply: Boolean; Source: Option Sales,Purchase; var NextEntryNo: Integer; var NextCheckEntryNo: Integer; NextTransactionNo: Integer; sender: Codeunit "Gen. Jnl.-Post Line")`
- `UnapplyWHTEntry(GenJnlLine: Record "Gen. Journal Line"; CVNo: Code[20]; TransactionNo: Integer; VoidCheck: Boolean; var NextWHTEntryNo: Integer; var NextEntryNo: Integer; var NextCheckEntryNo: Integer; NextTransactionNo: Integer; sender: Codeunit "Gen. Jnl.-Post Line")`

Plus 16 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) (37 calls: `ApplyVendLedgEntryOnBeforeOldVendLedgEntryModify → ProcessPayment`, `ApplyWHT → ApplyVendInvoiceWHTPosted`, `AssignBalGLAccValue → CheckVendorWithholdingTaxLiable`, …)
- [Codeunit 12 "Gen. Jnl.-Post Line"](../codeunit/12.md) (12 calls: `CalcDtldCVLedgEntryAmount → ExchangeAmtLCYToFCY2`, `CalcSourceCurrVATBaseAmount → CalcAmountSourceCurrency`, `InsertWHTPostingBufferPosted → InitGLEntry`, …)
- [Codeunit 13 "Gen. Jnl.-Post Batch"](../codeunit/13.md) (1 call: `OnProcessLinesOnAfterProcessICTransaction → PostGenJournalLines`)

## Recent changes

- 2026-08-19 [#9865 [Main] - 'Greater Than' Withholding Tax Calculation Rule is not app…](../../changes/bcapps/9865.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)
- 2026-07-17 [#9479 [Master]-]Withholding Tax Entries are not generated at payment because the Withholding Tax. Prod. Posting Group field gets not transferred to the payment line](../../changes/bcapps/9479.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: "Withholding Tax Jnl Subscriber")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
