---
id: object/codeunit/99000810
type: object
title: Codeunit 99000810 "Calculate Planning Route Line"
summary: Codeunit 99000810 "Calculate Planning Route Line" in Base Application (Microsoft.Manufacturing.Planning). 6 public procedures, 23 events. Present since at least BC23, still in BC30, changed in BC26-27.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "27"
  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: 882bcd0456322ad2bbf0be76ddc7631d892cb1862075f5e5e039c73b8bd4d3c4
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Manufacturing/Planning/CalculatePlanningRouteLine.Codeunit.al
    title: src/Layers/W1/BaseApp/Manufacturing/Planning/CalculatePlanningRouteLine.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: 99000810
name: Calculate Planning Route Line
namespace: Microsoft.Manufacturing.Planning
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "26"
  - "27"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 58
  events: 23
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 2
  called_by: 1
  implements: 0
---

# Codeunit 99000810 "Calculate Planning Route Line"

> Codeunit 99000810 "Calculate Planning Route Line" in Base Application (Microsoft.Manufacturing.Planning). 6 public procedures, 23 events. Present since at least BC23, still in BC30, changed in BC26-27.

Base Application · Microsoft.Manufacturing.Planning · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Manufacturing/Planning/CalculatePlanningRouteLine.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Permissions | TableData Item = r, TableData "Prod. Order Capacity Need" = rimd, TableData "Work Center" = r, TableData "Calendar Entry" = r, TableData "Machine Center" = r, TableData "Manufacturing Setup" = rm, TableData "Planning Routing Line" = rimd, TableData "Capacity Constrained Resource" = r |

## Events published

- `OnAfterCalcRoutingLineBack(PlanningRoutingLine: Record "Planning Routing Line"; PlanningResiliency: Boolean)` (integration)
- `OnAfterCalcRoutingLineForward(PlanningRoutingLine: Record "Planning Routing Line"; PlanningResiliency: Boolean)` (integration)
- `OnAfterCreatePlanningCapNeed(var NextCapNeedLineNo: Integer; var PlanningRoutingLine: Record "Planning Routing Line"; var ReqLine: Record "Requisition Line"; NeedDate: Date; StartingTime: Time; EndingTime: Time; TimeType: option "Setup Time","Run Time"; NeedQty: Decimal; ConCurrCap: Decimal; var CalendarEntry: Record "Calendar Entry"; LotSize: Decimal; RemainNeedQty: Decimal; FirstInBatch: Boolean; Direction: Option "Forward","Backward")` (integration)
- `OnBeforeCalcMoveTimeBack(var PlanningRoutingLine: Record "Planning Routing Line"; var WorkCenter: Record "Work Center"; var ProdEndingDate: Date; var ProdEndingTime: Time; var ProdStartingDate: Date; var ProdStartingTime: Time; var UpdateDates: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeCalcRoutingLineBack(var PlanningRoutingLine: Record "Planning Routing Line"; CalcStartEndDate: Boolean)` (integration)
- `OnBeforeCalcRoutingLineForward(var PlanningRoutingLine: Record "Planning Routing Line"; WorkCenter: Record "Work Center"; SendAheadLotSize: Decimal; MaxLotSize: Decimal; var TotalLotSize: Decimal; var RemainNeedQty: Decimal; var UpdateDates: Boolean; var FirstEntry: Boolean; var TempPlanningRoutingLine: Record "Planning Routing Line")` (integration)
- `OnBeforeCalcWaitTimeBack(var PlanningRoutingLine: Record "Planning Routing Line"; var WorkCenter: Record "Work Center"; var ProdEndingDate: Date; var ProdEndingTime: Time; var ProdStartingDate: Date; var ProdStartingTime: Time; var UpdateDates: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeCalculateRouteLine(var PlanningRoutingLine: Record "Planning Routing Line"; var CalcStartEndDate: Boolean; var Direction: Option)` (integration)
- `OnBeforeLoadCapForward(var PlanningRoutingLine: Record "Planning Routing Line"; TimeType: Enum "Routing Time Type"; var ProdStartingDate: Date; var ProdStartingTime: Time; var IsHandled: Boolean)` (integration)
- `OnBeforeSetLotSizesToMax(var SendAheadLotSize: Decimal; var TotalLotSize: Decimal; MaxLotSize: Decimal; PlanningRoutingLine: Record "Planning Routing Line"; var IsHandled: Boolean)` (integration)
- `OnCreateLoadBackOnBeforeFirstCalculate(var PlanningRoutingLine: Record "Planning Routing Line"; var IsHandled: Boolean)` (integration)
- `OnCreatePlanningCapNeedOnAfterCalulateExpectedUnitCost(var PlanningRoutingLine: Record "Planning Routing Line"; TimeType: Enum "Routing Time Type"; NeedQty: Decimal)` (integration)
- `OnBeforeCreatePlanningCapNeed(var PlanningRoutingLine: Record "Planning Routing Line"; TimeType: Enum "Routing Time Type"; var NeedQty: Decimal)` (integration)
- `OnCalculateRoutingLineBackOnAfterCalcRemainNeedQtyForLotSize(PlanningRoutingLine: Record "Planning Routing Line"; var RemainNeedQty: Decimal)` (integration)
- `OnCalcRoutingLineBackOnAfterCalcShouldCalcNextOperation(PlanningRoutingLine: Record "Planning Routing Line"; MaxLotSize: Decimal; var TotalLotSize: Decimal; var SendAheadLotSize: Decimal; var ShouldCalcNextOperation: Boolean)` (integration)
- `OnCalculateRoutingLineForwardOnAfterCalcRemainNeedQtyForLotSize(PlanningRoutingLine: Record "Planning Routing Line"; var RemainNeedQty: Decimal)` (integration)
- `OnBeforeGetConstrainedCapacity(CapType: Enum "Capacity Type"; CapNo: Code[20]; var ConstrainedCapacity: Record "Capacity Constrained Resource"; var Result: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeFinitelyLoadCapBack(TimeType: Enum "Routing Time Type"; ConstrainedCapacity: Record "Capacity Constrained Resource"; ResourceIsConstrained: Boolean; ParentWorkCenter: Record "Capacity Constrained Resource"; ParentIsConstrained: Boolean; var ProdEndingTime: Time; var ProdEndingDate: Date; var ConCurrCap: Decimal; var PlanningRoutingLine: Record "Planning Routing Line"; var CalendarEntry: Record "Calendar Entry"; var RemainNeedQty: Decimal; var WorkCenter: Record "Work Center"; var CurrentTimeFactor: Decimal; var CurrentRounding: Decimal; var CalculateRoutingLine: Codeunit "Calculate Routing Line"; var ReqLine: Record "Requisition Line"; var FirstInBatch: Boolean; var FirstEntry: Boolean; var NextCapNeedLineNo: Integer; var LotSize: Decimal; var PlanningResiliency: Boolean; var TempPlanningErrorLog: Record "Planning Error Log" temporary; var IsHandled: Boolean)` (integration)
- `OnBeforeLoadCapBack(var PlanningRoutingLine: Record "Planning Routing Line"; TimeType: Enum "Routing Time Type"; var ProdStartingDate: Date; var ProdStartingTime: Time; var IsHandled: Boolean)` (integration)
- `OnBeforeFinitelyLoadCapForward(var PlanningRoutingLine: Record "Planning Routing Line"; TimeType: Enum "Routing Time Type"; var ProdStartingDate: Date; var ProdStartingTime: Time; var IsHandled: Boolean; ConstrainedCapacity: Record "Capacity Constrained Resource"; ResourceIsConstrained: Boolean; ParentWorkCenter: Record "Capacity Constrained Resource"; ParentIsConstrained: Boolean; var ProdEndingTime: Time; var ProdEndingDate: Date; var ConCurrCap: Decimal; var CalendarEntry: Record "Calendar Entry"; var RemainNeedQty: Decimal; var WorkCenter: Record "Work Center"; var CurrentTimeFactor: Decimal; var CurrentRounding: Decimal; var CalculateRoutingLine: Codeunit "Calculate Routing Line"; var ReqLine: Record "Requisition Line"; var FirstInBatch: Boolean; var FirstEntry: Boolean; var NextCapNeedLineNo: Integer; var LotSize: Decimal; var PlanningResiliency: Boolean; var TempPlanningErrorLog: Record "Planning Error Log" temporary)` (integration)
- `OnCreatingLoadForwardOnAfterUpdateRemainNeedQtyBase(PlanningRoutingLine: Record "Planning Routing Line"; CalendarEntry: Record "Calendar Entry"; var EndingTime: Time)` (integration)
- `OnCreatingLoadBackOnAfterUpdateRemainNeedQtyBase(PlanningRoutingLine: Record "Planning Routing Line"; CalendarEntry: Record "Calendar Entry"; var StartingTime: Time)` (integration)
- `OnCreatePlanningCapNeedOnBeforeInsertProdOrderCapNeed(var ProdOrderCapacityNeed: Record "Prod. Order Capacity Need"; var RequisitionLine: Record "Requisition Line"; var PlanningRoutingLine: Record "Planning Routing Line")` (integration)

## Procedures

- `LoadCapForward(CapType: Enum "Capacity Type"; CapNo: Code[20]; TimeType: Enum "Routing Time Type"; Write: Boolean)`
- `CalcRoutingLineBack(CalcStartEndDate: Boolean)`
- `CalcRoutingLineForward(CalcStartEndDate: Boolean)`
- `CalculateRouteLine(var PlanningRoutingLine2: Record "Planning Routing Line"; Direction: Option Forward,Backward; CalcStartEndDate: Boolean; ReqLine2: Record "Requisition Line")`
- `SetResiliencyOn(WkshTemplName: Code[10]; JnlBatchName: Code[10]; ItemNo: Code[20])`
- `GetResiliencyError(var PlanningErrorLog: Record "Planning Error Log"): Boolean`

Plus 29 local procedures.

## Triggers

OnRun

## 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 99000755 "Shop Calendar Management"](../codeunit/99000755.md) (17 calls: `CalcMoveTimeBack → TimeFactor`, `CalcRoutingLineBack → GetMaxDate`, `CalcRoutingLineBack → TimeFactor`, …)
- [Codeunit 99000774 "Calculate Routing Line"](../codeunit/99000774.md) (6 calls: `CalculateDailyLoad → CalcAvailCapBaseAndDampTime`, `CreateLoadBack → CalcAvailQtyBase`, `CreateLoadBack → ReturnNextCalendarEntry`, …)

## Called by

- [Codeunit 99000808 "PlanningRoutingManagement"](../codeunit/99000808.md) (3 calls: `CalculateRoutingFromActual → CalculateRouteLine`, `CalculateRoutingFromActual → SetResiliencyOn`, `OnGetResiliencyErrorOnRouting → GetResiliencyError`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC26-27

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: "Calculate Planning Route Line")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
