---
id: object/codeunit/18466-in
type: object
title: Codeunit 18466 "Subcontracting Post" (IN)
summary: Codeunit 18466 "Subcontracting Post" (IN) in the IN country layer (Microsoft.Finance.GST.Subcontracting). 31 public procedures, 19 events, 5 event subscribers. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - in layer
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: 36a31e4c428f571988d046189b16b208714e352f90f5597621e3b69ebee6e872
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/IN/INGST/app/GSTSubcontracting/src/Codeunit/SubcontractingPost.Codeunit.al
    title: src/Apps/IN/INGST/app/GSTSubcontracting/src/Codeunit/SubcontractingPost.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/in
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/11710
    - change/bcapps/11673
    - change/bcapps/9729
object_type: codeunit
object_id: 18466
name: Subcontracting Post
namespace: Microsoft.Finance.GST.Subcontracting
app: INGST
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
country: IN
counts:
  fields: 0
  procedures: 64
  events: 19
  subscribers: 5
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
---

# Codeunit 18466 "Subcontracting Post" (IN)

> Codeunit 18466 "Subcontracting Post" (IN) in the IN country layer (Microsoft.Finance.GST.Subcontracting). 31 public procedures, 19 events, 5 event subscribers. Introduced in BC29, still in BC30.

IN country layer · Microsoft.Finance.GST.Subcontracting · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/IN/INGST/app/GSTSubcontracting/src/Codeunit/SubcontractingPost.Codeunit.al) · facts from BC29

An object of the [IN localization](../../localizations/in.md), not part of W1.

## Properties

| Property | Value |
|---|---|
| TableNo | Purchase Line |

## Events published

- `OnAfterSubcontractComponentSendPost(ItemJrnlLine: Record "Item Journal Line"; DeliveryChallanHeader: Record "Delivery Challan Header"; SubOrderCompList: Record "Sub Order Component List")` (integration)
- `OnBeforePostSubcontractOrder(var ProdOrderComponent: Record "Prod. Order Component"; ProdOrder: Record "Production Order"; ProdOrderLine: Record "Prod. Order Line"; PurchaseLine: Record "Purchase Line")` (integration)
- `OnAfterPostSubcontractOrder(ProdOrderComponent: Record "Prod. Order Component"; ProdOrder: Record "Production Order"; ProdOrderLine: Record "Prod. Order Line"; PurchaseLine: Record "Purchase Line")` (integration)
- `OnBeforeDeliveryChallanHeaderInsert(var DeliveryChallanHeader: Record "Delivery Challan Header"; SubOrderComponentList: Record "Sub Order Component List"; PurchLine: Record "Purchase Line")` (integration)
- `OnAfterDeliveryChallanHeaderInsert(DeliveryChallaneHeader: Record "Delivery Challan Header"; SubOrderComponentList: Record "Sub Order Component List"; PurchLine: Record "Purchase Line"; DeliveryChallanNo: Code[20]; SubcontractOrderNo: Code[20])` (integration)
- `OnBeforeDeliveryChallanLineInsert(var DeliveryChallanLine: Record "Delivery Challan Line"; DeliveryChallanNo: Code[20]; SubcontractOrderNo: Code[20])` (integration)
- `OnAfterDeliveryChallanLineInsert(DeliveryChallanLine: Record "Delivery Challan Line"; DeliveryChallanNo: Code[20]; SubcontractOrderNo: Code[20])` (integration)
- `OnBeforePostSubcontractComponent(var ItemJnlLine: Record "Item Journal Line"; AppliedDeliveryChallan: Record "Applied Delivery Challan"; SubOrderCompListVendor: Record "Sub Order Comp. List Vend"; ProdOrderComponent: Record "Prod. Order Component"; ProdOrderLine: Record "Prod. Order Line"; ItemLedgerEntry: Record "Item Ledger Entry")` (integration)
- `OnAfterValidateUnitofMeasureCodeSubcontract(var ItemJournalLine: Record "Item Journal Line"; ProdOrderComponent: Record "Prod. Order Component")` (integration)
- `OnAfterPostSubcontractComponent(ItemJnlLine: Record "Item Journal Line"; AppliedDeliveryChallan: Record "Applied Delivery Challan"; SubOrderCompListVendor: Record "Sub Order Comp. List Vend"; ProdOrderComponent: Record "Prod. Order Component"; ProdOrderLine: Record "Prod. Order Line"; ItemLedgerEntry: Record "Item Ledger Entry")` (integration)
- `OnAfterModifyApplyDeliveryChallan(var AppliedDeliveryChallan: Record "Applied Delivery Challan"; SubOrderCompVend: Record "Sub Order Comp. List Vend")` (integration)
- `OnBeforeModifyApplyDeliveryChallan(var AppliedDeliveryChallan: Record "Applied Delivery Challan"; SubOrderCompVend: Record "Sub Order Comp. List Vend")` (integration)
- `OnBeforeDelApplyDeliveryChallan(var ProdOrder: Record "Production Order"; var ProdOrderLine: Record "Prod. Order Line"; var ProdOrderComp: Record "Prod. Order Component"; var IsHandled: Boolean)` (integration)
- `OnBeforePostSubconComp(var ProdOrder: Record "Production Order"; var ProdOrderLine: Record "Prod. Order Line"; var ProdOrderComp: Record "Prod. Order Component"; var Purchaseline: Record "Purchase line"; var IsHandled: Boolean)` (integration)
- `OnBeforeRecieveBackComp(var ProdOrder: Record "Production Order"; var ProdOrderLine: Record "Prod. Order Line"; var ProdOrderComp: Record "Prod. Order Component"; var IsHandled: Boolean)` (integration)
- `OnBeforePostSubconCompCE(var ProdOrder: Record "Production Order"; var ProdOrderLine: Record "Prod. Order Line"; var ProdOrderComp: Record "Prod. Order Component"; var Purchline: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnBeforePostScrapAtVE(ProdOrder: Record "Production Order"; ProdOrderLine: Record "Prod. Order Line"; ProdOrderComp: Record "Prod. Order Component"; PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeGetApplicationLines(ProdOrderComp: Record "Prod. Order Component"; SubOrderCompVend: Record "Sub Order Comp. List Vend"; var ItemLedgerEntry: Record "Item Ledger Entry"; TotalQtyToPost: Decimal; AppDelChallan: Record "Applied Delivery Challan"; var IsHandled: Boolean)` (integration)
- `OnBeforeSubcontCompSendPost(var ItemJrnlLine: Record "Item Journal Line"; DeliveryChallanHeader: Record "Delivery Challan Header"; SubOrderCompList: Record "Sub Order Component List"; var IsHandled: Boolean)` (integration)

## Event subscriptions

- OnBeforeProcessAssocItemJnlLineSubcon subscribes to Codeunit "Purch.-Post" OnBeforeProcessAssocItemJnlLine
- OnBeforeAllowProdApplicationSubcon subscribes to Codeunit "Item Jnl.-Post Line" OnBeforeAllowProdApplication
- OnAfterPostItemJnlLineCopyProdOrder subscribes to Codeunit "Mfg. Purch.-Post" OnAfterPostItemJnlLineCopyProdOrder
- OnBeforeValidateQtyToInvoice subscribes to Table "Purchase Line" OnBeforeValidateQtyToInvoice
- UpdateSourceDocument subscribes to Codeunit "WMS Management" OnAfterCreateWhseJnlLine

## Procedures

- `PostPurchOrder(PurchLine: Record "Purchase Line")`
- `PostSubcon(var PurchLine: Record "Purchase Line")`
- `CreateDeliveryChallan(var SubOrderComponentList: Record "Sub Order Component List"; PurchLine: Record "Purchase Line")`
- `PostSubconComp(ProdOrder: Record "Production Order"; ProdOrderLine: Record "Prod. Order Line"; ProdOrderComp: Record "Prod. Order Component"; Purchaseline: Record "Purchase line")`
- `RecieveBackCompRW(SubOrderCompList: Record "Sub Order Component List")`
- `PostScrapAtVE(ProdOrder: Record "Production Order"; ProdOrderLine: Record "Prod. Order Line"; ProdOrderComp: Record "Prod. Order Component"; PurchaseLine: Record "Purchase Line")`
- `SendAgain(SubOrderCompList: Record "Sub Order Component List")`
- `ReInitializeSubConQtys(var PurchLine: Record "Purchase Line")`
- `RecieveBackComp(ProdOrder: Record "Production Order"; ProdOrderLine: Record "Prod. Order Line"; ProdOrderComp: Record "Prod. Order Component")`
- `PostSubconCompCE(ProdOrder: Record "Production Order"; ProdOrderLine: Record "Prod. Order Line"; ProdOrderComp: Record "Prod. Order Component"; Purchline: Record "Purchase Line")`
- `GetApplicationLines(ProdOrderComp: Record "Prod. Order Component"; SubOrderCompVend: Record "Sub Order Comp. List Vend"; var ItemLedgerEntry: Record "Item Ledger Entry"; TotalQtyToPost: Decimal; AppDelChallan: Record "Applied Delivery Challan")`
- `CreatePostedReceipt(PurchLine: Record "Purchase Line")`
- `SendFromDC(SubcontractorDeliveryChallan: Record "Subcontractor Delivery Challan")`
- `PostDCLine(SubconDeliveryChallanLine: Record "Subcon. Delivery Challan Line")`
- `CreatePostedDeliveryChallan(SubcontractorDeliveryChallan: Record "Subcontractor Delivery Challan")`
- `CheckAppDelChallan(SubOrderCompListVend2: Record "Sub Order Comp. List Vend")`
- `CheckIfAppDelChallan(SubOrderCompListVend2: Record "Sub Order Comp. List Vend")`
- `DelAppDelChallan(ProdOrder: Record "Production Order"; ProdOrderLine: Record "Prod. Order Line"; ProdOrderComp: Record "Prod. Order Component")`
- `GetTrackingQuantities(SubOrderCompList: Record "Sub Order Component List"; FunctionType: Option CheckTrackingExists,GetQty; var TrackingQtyToHandle: Decimal; var TrackingQtyHandled: Decimal): Boolean`
- `FilterReservFor(var FilterReservEntry: Record "Reservation Entry"; SubOrderComp: Record "Sub Order Component List"; Direction: Option Outbound,Inbound)`
- `FindReservEntry(SubOrderComp: Record "Sub Order Component List"; var ReservEntry: Record "Reservation Entry"; Direction: Option Outbound,Inbound): Boolean`
- `TransferTrackingToItemJnlLine(var SubOrderComp: Record "Sub Order Component List"; var ItemJnlLine: Record "Item Journal Line"; TransferQty: Decimal; Direction: Option Outbound,Inbound)`
- `TransferTrackingToItemJnlLineV(var AppliedDeliveryChallan: Record "Applied Delivery Challan"; var ItemJnlLine: Record "Item Journal Line"; TransferQty: Decimal; Direction: Option Outbound,Inbound; ItemLedgerEntry: Record "Item Ledger Entry"; Type_: Option Consume,RejectVE,RejectCE,Receive,Rework)`
- `FindReservEntryVend(AppliedDeliveryChallan: Record "Applied Delivery Challan"; var ReservEntry: Record "Reservation Entry"; Direction: Option Outbound,Inbound; ItemLedgerEntry: Record "Item Ledger Entry"; Type_: Option Consume,RejectVE,RejectCE,Receive,Rework): Boolean`
- `FilterReservForVend(var FilterReservEntry: Record "Reservation Entry"; AppliedDeliveryChallan: Record "Applied Delivery Challan"; Direction: Option Outbound,Inbound; ItemLedgerEntry: Record "Item Ledger Entry"; Type_: Option Consume,RejectVE,RejectCE,Receive,Rework)`
- `FindReservEntryVendBef(AppliedDeliveryChallan: Record "Applied Delivery Challan"; var ReservEntry: Record "Reservation Entry"; Direction: Option Outbound,Inbound; ItemLedgerEntry: Record "Item Ledger Entry"; Type_: Option Consume,RejectVE,RejectCE,Receive,Rework): Boolean`
- `CheckItemTracking(AppliedDeliveryChallan: Record "Applied Delivery Challan"; Type_: Option Consume,RejectVE,RejectCE,Receive,Rework)`
- `GetReceiptNo(ReceivingNo: Code[20])`
- `PostAppliedDeliveryChallan(ProdOrderComponent: Record "Prod. Order Component")`
- `ItemJournalLineEntryTypeEnum2EntryTypeOption(ItemJournalType: Enum "Item Ledger Entry Type"): Option`
- `GetDimensionsFromPurchaseLine(var ItemJournalLine: Record "Item Journal Line"; SubOrderCompList: Record "Sub Order Component List")`

Plus 9 local procedures.

## Triggers

OnRun

## Recent changes

- 2026-09-22 [#11710 [29.x]-Not enough inventory available at vendor location for this order](../../changes/bcapps/11710.md) (releases/29.x, BC29, fix)
- 2026-09-22 [#11673 #[MAIN]-Not enough inventory available at vendor location for this order](../../changes/bcapps/11673.md) (main, BC30, fix)
- 2026-08-17 [#9729 [MAIN]-The system throws the error while posting a receipt against a Subcontracting Order.](../../changes/bcapps/9729.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). 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: "Subcontracting Post")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.

A IN country object, not part of W1: the default corpus does not have it; `bcatlas_list_countries` shows which countries the atlas has.
