---
id: object/codeunit/5431
type: object
title: Codeunit 5431 "Calc. Item Plan - Plan Wksh."
summary: Codeunit 5431 "Calc. Item Plan - Plan Wksh." in Base Application (Microsoft.Manufacturing.Planning). 9 public procedures, 13 events. Present since at least BC23, still in BC30, changed in BC25, BC27-28, BC30.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "30"
  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: a0d4030a22e6e3f6b64df0434352b4d99337e19a6660207391d59654e9476da0
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Inventory/Planning/CalcItemPlanPlanWksh.Codeunit.al
    title: src/Layers/W1/BaseApp/Inventory/Planning/CalcItemPlanPlanWksh.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/12066
    - change/bcapps/9196
object_type: codeunit
object_id: 5431
name: Calc. Item Plan - Plan Wksh.
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:
  - "25"
  - "27"
  - "28"
  - "30"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 27
  events: 13
  subscribers: 0
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 3
  calls: 2
  called_by: 0
  implements: 0
---

# Codeunit 5431 "Calc. Item Plan - Plan Wksh."

> Codeunit 5431 "Calc. Item Plan - Plan Wksh." in Base Application (Microsoft.Manufacturing.Planning). 9 public procedures, 13 events. Present since at least BC23, still in BC30, changed in BC25, BC27-28, BC30.

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

## Properties

| Property | Value |
|---|---|
| TableNo | Item |

## Events published

- `OnBeforeCheckPreconditions(var Item: Record Item; MPS: Boolean; MRP: Boolean; FromDate: Date; ToDate: Date; var IsHandled: Boolean)` (integration)
- `OnBeforeCalculateAndGetPlanningCompList(var Item: Record Item; CurrTemplateName: Code[10]; CurrWorksheetName: Code[10]; ToDate: Date; FromDate: Date; UseForecast: Code[10]; ExcludeForecastBefore: Date; MfgSetup: Record Microsoft.Manufacturing.Setup."Manufacturing Setup"; MRP: Boolean; RespectPlanningParm: Boolean; var TempPlanningCompList: Record "Planning Component" temporary; var IsHandled: Boolean; var InventoryProfileOffsetting: Codeunit "Inventory Profile Offsetting")` (integration, obsolete 27.0)
- `OnBeforeCalculateAndGetPlanningComponents(var Item: Record Item; CurrTemplateName: Code[10]; CurrWorksheetName: Code[10]; ToDate: Date; FromDate: Date; UseForecast: Code[10]; ExcludeForecastBefore: Date; MRP: Boolean; RespectPlanningParm: Boolean; var TempPlanningCompList: Record "Planning Component" temporary; var IsHandled: Boolean; var InventoryProfileOffsetting: Codeunit "Inventory Profile Offsetting")` (integration)
- `OnBeforePlanThisItem(Item: Record Item; var IsHandled: Boolean; MPS: Boolean; MRP: Boolean; NetChange: Boolean; var FromDate: Date; ToDate: Date; UseForecast: Code[10]; RespectPlanningParm: Boolean; var Result: Boolean)` (integration)
- `OnCodeOnAfterGetPlanningComponents(Item: Record Item)` (integration)
- `OnCodeOnAfterSetReqLineFilters(var ReqLineExtern: Record "Requisition Line"; CurrTemplateName: Code[10]; CurrWorksheetName: Code[10]; var FromDate: Date; var ToDate: Date)` (integration)
- `OnCodeOnBeforeInvtProfileOffsettingSetParm(Item: Record Item)` (integration)
- `OnCodeOnBeforeTempItemListInsert(TempItemList: Record Item temporary; var IsHandled: Boolean)` (integration)
- `OnPlanThisItemOnBeforeCheckServJobPlanningLines(var Item: Record Item; var IsHandled: Boolean; MPS: Boolean; MRP: Boolean; NetChange: Boolean; var FromDate: Date; ToDate: Date; UseForecast: Code[10]; RespectPlanningParm: Boolean; var Result: Boolean; var DoExit: Boolean)` (integration)
- `OnPlanThisItemOnBeforeExitMPS(var Item: Record Item; var LinesExist: Boolean)` (integration)
  - subscribers: [Codeunit 6450 "Serv. Integration Mgt."](../codeunit/6450.md) OnPlanThisItemOnBeforeExitMPS
- `OnAfterCode(var TempItemList: Record Item temporary; var FromDate: Date; var ToDate: Date)` (integration)
- `OnAfterReqLineExternDelete(var Item: Record Item)` (integration)
  - subscribers: [Codeunit 99000821 "Mfg. CalcItemPlanPlanWksh"](../codeunit/99000821.md) OnAfterReqLineExternDelete
- `OnProdOrderLineIsEmpty(var Item: Record Item; var Result: Boolean)` (integration)
  - subscribers: [Codeunit 99000821 "Mfg. CalcItemPlanPlanWksh"](../codeunit/99000821.md) OnProdOrderLineIsEmpty

## Procedures

- `Initialize(NewFromDate: Date; NewToDate: Date; NewMPS: Boolean; NewMRP: Boolean; NewRespectPlanningParm: Boolean)`
- `Finalize()`
- `SetTemplAndWorksheet(TemplateName: Code[10]; WorksheetName: Code[10]; NetChange2: Boolean)`
- `SetParm(Forecast: Code[10]; ExclBefore: Date; var Item2: Record Item)`
- `SetResiliencyOn()`
- `GetResiliencyError(var PlanningErrorLogEntry: Record "Planning Error Log"): Boolean`
- `GetResiliencyErrors(var PlanningErrorLogEntry: Record "Planning Error Log"): Boolean`: Gets the resiliency errors for the current item in planning and logs them in the "Planning Error Log" table.
- `GetPlanningSkippedForMissingSKUPolicy(): Boolean`: Gets whether planning was skipped for the current item due to a missing SKU policy.
- `ClearInvtProfileOffsetting()`

Plus 5 local procedures.

## Triggers

OnRun

## Relations

- runs on [Table 27 "Item"](../table/27.md)

## 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 99000854 "Inventory Profile Offsetting"](../codeunit/99000854.md) (7 calls: `CalculateAndGetPlanningCompList → CalculatePlanFromWorksheet`, `CalculateAndGetPlanningCompList → GetPlanningCompList`, `CalculateAndGetPlanningCompList → SetParm`, …)
- [Codeunit 99000845 "Reservation Management"](../codeunit/99000845.md) (2 calls: `Finalize → AutoTrack`, `Finalize → SetReservSource`)

## Recent changes

- 2026-10-02 [#12066 Bugs/remove asm inv mfg clean27 tags for wave2 2026](../../changes/bcapps/12066.md) (main, BC30, obsoletion)
- 2026-08-27 [#9196 [Master] - What If Impact on Planning and Supply](../../changes/bcapps/9196.md) (main, BC30, feature)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC25, BC27-28, BC30

## Deprecations

- procedure OnBeforeCalculateAndGetPlanningCompList: Pending 27.0 (#if not CLEAN27), "Replaced by event OnBeforeCalculateAndGetPlanningComponents()"

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: "Calc. Item Plan - Plan Wksh.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
