---
title: "Codeunit 8002 Create Sub. Contract Renewal, extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/points/
object: https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/
app: "Subscription Billing"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/
checked: 2026-11-20
changed: 2026-10-28
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 8002 Create Sub. Contract Renewal, extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/points/

13 procedures and triggers with a step in src/Apps/W1/Subscription Billing/App/Contract Renewal/Codeunits/CreateSubContractRenewal.Codeunit.al, in source order, read from the text, not from a run.

## OnRun

[Line 13](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L13), trigger.

- [16](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L16) calls `CreateSingleContractRenewal`

## RunCheck

[Line 19](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L19), local.

- [27](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L27) calls `CheckContractRenewalLine`
- [30](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L30) raises `OnAfterRunCheck`

## CheckContractRenewalLine

[Line 33](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L33), local.

- [56](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L56) calls [Codeunit 8003 Sub. Contract Renewal Mgt.](https://jonas-paprotka.de/ref/codeunit/8003-sub-contract-renewal-mgt/) `ExistsInSalesOrderOrSalesQuote`
- [63](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L63) raises `OnAfterCheckSubContractRenewalLine`

## BatchCreateContractRenewal

[Line 66](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L66), internal.

- [90](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L90) calls `CallCreateSingleContractRenewalFromBatch`
- [92](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L92) writes [Table 8001 Sub. Contract Renewal Line](https://jonas-paprotka.de/ref/table/8001-sub-contract-renewal-line/) DeleteAll
- [96](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L96) writes [Table 8001 Sub. Contract Renewal Line](https://jonas-paprotka.de/ref/table/8001-sub-contract-renewal-line/) Insert
- [102](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L102) writes [Table 8001 Sub. Contract Renewal Line](https://jonas-paprotka.de/ref/table/8001-sub-contract-renewal-line/) Insert
- [105](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L105) calls `CallCreateSingleContractRenewalFromBatch`
- [107](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L107) writes [Table 8001 Sub. Contract Renewal Line](https://jonas-paprotka.de/ref/table/8001-sub-contract-renewal-line/) DeleteAll
- [111](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L111) calls `OpenSalesQuotes`

## OpenSalesQuotes

[Line 114](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L114), internal.

- [129](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L129) calls [Codeunit 27 Confirm Management](https://jonas-paprotka.de/ref/codeunit/27-confirm-management/) `GetResponse`
- [131](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L131) runs [Page 41 Sales Quote](https://jonas-paprotka.de/ref/page/41-sales-quote/)
- [136](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L136) calls [Codeunit 27 Confirm Management](https://jonas-paprotka.de/ref/codeunit/27-confirm-management/) `GetResponse`
- [138](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L138) runs [Page 9300 Sales Quotes](https://jonas-paprotka.de/ref/page/9300-sales-quotes/)

## CallCreateSingleContractRenewalFromBatch

[Line 143](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L143), local.

- [157](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L157) runs [Codeunit 8002 Create Sub. Contract Renewal](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/)
- [163](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L163) writes [Table 8001 Sub. Contract Renewal Line](https://jonas-paprotka.de/ref/table/8001-sub-contract-renewal-line/) Modify
- [166](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L166) calls [Codeunit 8002 Create Sub. Contract Renewal](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/) `GetSalesQuoteNo`

## CreateSingleContractRenewal

[Line 170](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L170), local.

- [174](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L174) calls `RunCheck`
- [180](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L180) calls `CreateSalesQuoteHeaderFromCustomerContract`
- [188](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L188) calls `CreateSalesQuoteLineFromContractRenewalLine`
- [190](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L190) raises `OnAfterCreateSingleContractRenewal`

## CreateSalesQuoteHeaderFromCustomerContract

[Line 193](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L193), local.

- [198](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L198) calls [Codeunit 8063 Sales Documents](https://jonas-paprotka.de/ref/codeunit/8063-sales-documents/) `SetCalledFromContractRenewal`
- [203](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L203) writes [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) Insert(true)
- [204](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L204) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `SetHideValidationDialog`
- [205](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L205) validates [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `Sell-to Customer No.`
- [207](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L207) validates [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `Bill-to Customer No.`
- [217](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L217) validates [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `Document Date`
- [218](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L218) validates [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `Currency Code`
- [220](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L220) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `SetHideValidationDialog`
- [221](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L221) writes [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) Modify
- [224](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L224) raises `OnAfterCreateSalesHeaderFromSubscriptionContract`
- [226](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L226) calls `CreateDescriptionLines`
- [227](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L227) calls [Codeunit 8063 Sales Documents](https://jonas-paprotka.de/ref/codeunit/8063-sales-documents/) `SetCalledFromContractRenewal`

## CreateSalesQuoteLineFromContractRenewalLine

[Line 230](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L230), local.

- [240](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L240) raises `OnBeforeCreateSalesQuoteLineFromSubContractRenewalLine`
- [246](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L246) calls `InsertTermInfoLine`
- [248](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L248) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `InitFromSalesHeader`
- [250](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L250) validates [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `No.`
- [251](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L251) validates [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `Unit of Measure Code`
- [253](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L253) validates [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `Quantity`
- [255](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L255) validates [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `Unit Price`
- [258](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L258) validates [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `Unit Price`
- [259](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L259) calls [Table 330 Currency Exchange Rate](https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/) `ExchangeAmtFCYToFCY`
- [260](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L260) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `GetUseDate`
- [266](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L266) validates [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `Line Discount %`
- [267](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L267) validates [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `Unit Cost (LCY)`
- [268](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L268) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `GetCombinedDimensionSetID`
- [270](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L270) writes [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) Insert
- [272](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L272) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `DeleteSalesServiceCommitment`
- [274](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L274) calls [Codeunit 53 Translation Helper](https://jonas-paprotka.de/ref/codeunit/53-translation-helper/) `SetGlobalLanguageByCode`
- [275](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L275) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `InsertDescriptionSalesLine`
- [275](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L275) calls [Table 8057 Subscription Header](https://jonas-paprotka.de/ref/table/8057-subscription-header/) `GetSerialNoDescription`
- [276](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L276) calls [Codeunit 53 Translation Helper](https://jonas-paprotka.de/ref/codeunit/53-translation-helper/) `RestoreGlobalLanguage`
- [278](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L278) raises `OnAfterInsertSalesQuoteLineFromSubContractRenewalLine`
- [280](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L280) calls `AddServiceCommitment`
- [281](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L281) calls `AddLinkedServiceCommitment`
- [282](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L282) raises `OnAfterAddSubscriptionLinesToSalesLine`
- [285](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L285) writes [Table 8001 Sub. Contract Renewal Line](https://jonas-paprotka.de/ref/table/8001-sub-contract-renewal-line/) Delete

## AddLinkedServiceCommitment

[Line 288](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L288), local.

- [298](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L298) calls `AddServiceCommitment`
- [300](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L300) writes [Table 8001 Sub. Contract Renewal Line](https://jonas-paprotka.de/ref/table/8001-sub-contract-renewal-line/) Delete

## AddServiceCommitment

[Line 304](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L304), local.

- [312](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L312) raises `OnBeforeInsertSubscriptionLine`, IsHandled
- [320](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L320) calls [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) `InitRecord`
- [321](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L321) writes [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) Insert
- [323](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L323) validates [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) `Item No.`
- [325](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L325) validates [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) `Subscription Package Code`
- [328](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L328) validates [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) `Extension Term`
- [329](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L329) validates [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) `Notice Period`
- [330](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L330) validates [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) `Initial Term`
- [333](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L333) validates [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) `Billing Base Period`
- [335](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L335) validates [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) `Billing Rhythm`
- [336](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L336) validates [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) `Agreed Sub. Line Start Date`
- [338](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L338) validates [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) `Calculation Base Amount`
- [340](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L340) validates [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) `Price`
- [341](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L341) validates [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) `Discount %`
- [349](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L349) writes [Table 8068 Sales Subscription Line](https://jonas-paprotka.de/ref/table/8068-sales-subscription-line/) Modify
- [351](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L351) raises `OnAfterInsertSubscriptionLine`

## InsertTermInfoLine

[Line 354](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L354), local.

- [374](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L374) calls [Codeunit 53 Translation Helper](https://jonas-paprotka.de/ref/codeunit/53-translation-helper/) `SetGlobalLanguageByCode`
- [376](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L376) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `InsertDescriptionSalesLine`
- [377](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L377) calls [Codeunit 53 Translation Helper](https://jonas-paprotka.de/ref/codeunit/53-translation-helper/) `RestoreGlobalLanguage`
- [381](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L381) raises `OnAfterInsertTermInfoLine`

## CreateDescriptionLines

[Line 384](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L384), local.

- [398](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L398) raises `OnBeforeInsertSubscriptionContractDescriptionSalesLines`, IsHandled
- [400](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L400) calls [Codeunit 53 Translation Helper](https://jonas-paprotka.de/ref/codeunit/53-translation-helper/) `SetGlobalLanguageByCode`
- [401](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L401) calls [Codeunit 8060 Create Billing Documents](https://jonas-paprotka.de/ref/codeunit/8060-create-billing-documents/) `GetContractTypeDescription`
- [405](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L405) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `InsertDescriptionSalesLine`
- [407](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L407) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `InsertDescriptionSalesLine`
- [408](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L408) calls [Codeunit 53 Translation Helper](https://jonas-paprotka.de/ref/codeunit/53-translation-helper/) `RestoreGlobalLanguage`
- [410](https://jonas-paprotka.de/ref/codeunit/8002-create-sub-contract-renewal/source/#L410) raises `OnAfterInsertSubscriptionContractDescriptionSalesLines`

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
