---
id: change/bcapps/12669
type: change
title: "#12669 [Main]Subcontracting Order Date does not account for lead time before the routing operation starts"
summary: Subcontracting order dates now correctly calculate backward from the routing operation start date using the purchase lead time, and prices are refreshed when the order date changes on existing orders.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit subcontracting management
  - codeunit subc. req. wksh. make ord.
  - report subc. calculate subcontracts
  - codeunit subc. price management
  - codeunit subc. purchase order creator
system: manufacturing
review:
  state: reviewed
  by: opus
  at: "2026-10-16T01:17:12.415Z"
  flags: []
generated:
  at: "2026-11-19T00:15:47.846Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 8f7f5abb9da7df93f4dbe2092dca39a45d96857b
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/12669
    title: "microsoft/BCApps#12669: [Main]Subcontracting Order Date does not account for lead time before the routing operation starts"
    date: "2026-10-14"
    commit: 8f7f5abb9da7df93f4dbe2092dca39a45d96857b
    t: null
    quote: Subcontracting Order Date does not account for lead time before the routing operation starts
links:
  learn: []
  objects:
    - object/codeunit/20505
    - object/codeunit/20516
    - object/report/20505
    - object/codeunit/20508
    - object/codeunit/20557
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/upgrade/deprecated-features-w1
      title: Deprecated features in the application
      label: possibly related
      why: touches Report 20505 "Subc. Calculate Subcontracts"
      by: code
    - to: https://learn.microsoft.com/dynamics365/business-central/purchasing-date-calculation-for-purchases
      title: Calculate dates for purchases
      label: possibly related
      why: Documents purchase order date calculation with lead time lookups that directly applies to subcontracting order date fixes.
      by: model
number: 12669
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/12669
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-14T08:06:13Z"
author: sanjmaurya
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 6
  additions: 309
  deletions: 13
  al: 5
apps:
  - Subcontracting
objects_touched:
  - key: codeunit/20505
    page: codeunit/20505
    type: codeunit
    id: 20505
    name: Subcontracting Management
    app: Subcontracting
    status: modified
  - key: codeunit/20516
    page: codeunit/20516
    type: codeunit
    id: 20516
    name: Subc. Req. Wksh. Make Ord.
    app: Subcontracting
    status: modified
  - key: report/20505
    page: report/20505
    type: report
    id: 20505
    name: Subc. Calculate Subcontracts
    app: Subcontracting
    status: modified
  - key: codeunit/20508
    page: codeunit/20508
    type: codeunit
    id: 20508
    name: Subc. Price Management
    app: Subcontracting
    status: modified
  - key: codeunit/20557
    page: codeunit/20557
    type: codeunit
    id: 20557
    name: Subc. Purchase Order Creator
    app: Subcontracting
    status: modified
objects_unjoined: []
obsoletions: []
backports:
  - number: 12820
    base: releases/29.x
    url: https://github.com/microsoft/BCApps/pull/12820
fixes_issues: []
work_items:
  - 653858
systems:
  - manufacturing
quote: Subcontracting Order Date does not account for lead time before the routing operation starts
joined_against:
  major: "30"
  commit: f18567dc08e2bd162bf192e1da4d714b57eb099f
---

# #12669 [Main]Subcontracting Order Date does not account for lead time before the routing operation starts

> Subcontracting order dates now correctly calculate backward from the routing operation start date using the purchase lead time, and prices are refreshed when the order date changes on existing orders.

[Pull request](https://github.com/microsoft/BCApps/pull/12669) · merged into `main` (BC30) on 2026-10-14 by sanjmaurya · 6 files (+309 -13), 5 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Order Date calculation now accounts for purchase lead time from routing start date
- SetSubcontractingOrderDate method added to handle consistent date logic across Calculate Subcontracts and direct routing creation flows
- Carry Out Action no longer overwrites worksheet dates with purchase header order date for subcontracting lines
- Price refresh logic improved to treat pre-price fallback costs as automatic so correct prices apply to the calculated order date
- Expected and Requested Receipt Dates also set correctly on new and rescheduled purchase lines
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 20505 "Subcontracting Management"](../../objects/codeunit/20505.md), Subcontracting: modified
- [Codeunit 20516 "Subc. Req. Wksh. Make Ord."](../../objects/codeunit/20516.md), Subcontracting: modified
- [Report 20505 "Subc. Calculate Subcontracts"](../../objects/report/20505.md), Subcontracting: modified
- [Codeunit 20508 "Subc. Price Management"](../../objects/codeunit/20508.md), Subcontracting: modified
- [Codeunit 20557 "Subc. Purchase Order Creator"](../../objects/codeunit/20557.md), Subcontracting: modified

## Also merged into

- [#12820](https://github.com/microsoft/BCApps/pull/12820) into `releases/29.x` on 2026-10-21

## Context

- Work items: AB#653858
- Labels: AL: Apps (W1), Team: SCM
- Systems: manufacturing
- From the description: "Subcontracting Order Date does not account for lead time before the routing operation starts"

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Deprecated features in the application](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/upgrade/deprecated-features-w1) — possibly related: touches Report 20505 "Subc. Calculate Subcontracts"
- [Calculate dates for purchases](https://learn.microsoft.com/dynamics365/business-central/purchasing-date-calculation-for-purchases) — possibly related: Documents purchase order date calculation with lead time lookups that directly applies to subcontracting order date fixes. (model-linked)

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
