---
id: object/codeunit/8004
type: object
title: Codeunit 8004 "Post Sub. Contract Renewal"
summary: Codeunit 8004 "Post Sub. Contract Renewal" in Subscription Billing (Microsoft.SubscriptionBilling). 5 public procedures, 5 events. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - subscription billing
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: 1341abca34d76491b02a866557d3ca97e52398e60ead69ff4d7c68b29eb66d6e
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/Subscription%20Billing/app/Contract%20Renewal/Codeunits/PostSubContractRenewal.Codeunit.al
    title: src/Apps/W1/Subscription Billing/app/Contract Renewal/Codeunits/PostSubContractRenewal.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 8004
name: Post Sub. Contract Renewal
namespace: Microsoft.SubscriptionBilling
app: Subscription Billing
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: 21
  events: 5
  subscribers: 0
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 0
  called_by: 0
  implements: 0
---

# Codeunit 8004 "Post Sub. Contract Renewal"

> Codeunit 8004 "Post Sub. Contract Renewal" in Subscription Billing (Microsoft.SubscriptionBilling). 5 public procedures, 5 events. Introduced in BC29, still in BC30.

Subscription Billing · Microsoft.SubscriptionBilling · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/Subscription%20Billing/app/Contract%20Renewal/Codeunits/PostSubContractRenewal.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| TableNo | Sales Header |

## Events published

- `OnBeforeUpdateSubscriptionLineFromPlannedSubscriptionLine(var SubscriptionLine: Record "Subscription Line"; var PlannedSubscriptionLine: Record "Planned Subscription Line")` (integration)
- `OnCheckPerformSubscriptionLineUpdate(SubscriptionLine: Record "Subscription Line"; PlannedSubscriptionLine: Record "Planned Subscription Line"; var PerformUpdate: Boolean)` (integration)
- `OnBeforeInsertPlannedSubscriptionLineFromSalesSubscriptionLine(SalesLine: Record "Sales Line"; SalesSubscriptionLine: Record "Sales Subscription Line"; var IsHandled: Boolean)` (integration)
- `OnAfterInsertPlannedSubscriptionLineFromSalesSubscriptionLine(SalesLine: Record "Sales Line"; var TempSubscriptionLine: Record "Subscription Line"; var PlannedSubscriptionLine: Record "Planned Subscription Line")` (integration)
- `OnBeforeProcessPlannedSubscriptionLine(var PlannedSubscriptionLine: Record "Planned Subscription Line"; var IsHandled: Boolean)` (integration)

## Procedures

- `ProcessPlannedServCommsForPostedSalesInvoice(var SalesInvoiceHeader: Record "Sales Invoice Header")` (internal)
- `ProcessPlannedServCommsForPostedSalesCreditMemo(var SalesCrMemoHeader: Record "Sales Cr.Memo Header")` (internal)
- `ProcessPlannedServCommsForPostedPurchaseInvoice(var PurchInvHeader: Record "Purch. Inv. Header")` (internal)
- `ProcessPlannedServCommsForPostedPurchaseCreditMemo(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.")` (internal)
- `ProcessPlannedServiceCommitment(PlannedServiceCommitment: Record "Planned Subscription Line")`: Updates the existing subscription line from planned subscription line. It is used for subscription renewal.

Plus 11 local procedures.

## Triggers

OnRun

## Relations

- runs on [Table 36 "Sales Header"](../table/36.md)

## 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: "Post Sub. Contract Renewal")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
