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

# Codeunit 1005 "Job Calculate Batches"

> Codeunit 1005 "Job Calculate Batches" in Base Application (Microsoft.Projects.Project.Journal). 12 public procedures, 14 events. Present since at least BC23, still in BC30, changed in BC24-25.

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

## Events published

- `OnBeforeJobPlanningLineInsert(var JobPlanningLine: Record "Job Planning Line")` (integration)
- `OnBeforePostDiffBuffer(var JobDiffBuffer: array[2] of Record "Job Difference Buffer" temporary; var IsHandled: Boolean)` (integration)
- `OnBeforeTransferToPlanningLine(var JobLedgerEntry: Record "Job Ledger Entry")` (integration)
- `OnCreateJTOnBeforeAssigneJobDiffBuffer2(var JobDiffBuffer: array[2] of Record "Job Difference Buffer" temporary; JobPlanningLine: Record "Job Planning Line")` (integration)
- `OnChangeCurrencyDatesOnBeforeJobPlanningLineModify(var JobPlanningLine: Record "Job Planning Line")` (integration)
- `OnChangePlanningDatesOnBeforeJobPlanningLineModify(var JobPlanningLine: Record "Job Planning Line")` (integration)
- `OnPostDiffBufferOnAfterInsertJobJnlLine(var JobJnlLine: Record "Job Journal Line"; var JobDiffBuffer: Record "Job Difference Buffer" temporary)` (integration)
- `OnPostDiffBufferOnBeforeModify(var JobLedgEntry: Record "Job Ledger Entry"; var JobDiffBuffer: Record "Job Difference Buffer" temporary)` (integration)
- `OnPostDiffBufferOnAfterSetFilters(var JobLedgerEntry: Record "Job Ledger Entry"; var JobDifferenceBuffer: Record "Job Difference Buffer" temporary)` (integration)
- `OnBeforeCreateJT(var IsHanlded: Boolean; JobPlanningLine: Record "Job Planning Line")` (integration)
- `OnBeforeInsertDiffBuffer(var JobLedgerEntry: Record "Job Ledger Entry"; var JobPlanningLine: Record "Job Planning Line"; var JobDiffBuffer: array[2] of Record "Job Difference Buffer" temporary; LineType: Option Schedule,Usage; CurrencyType: Option LCY,FCY)` (integration)
- `OnAfterInsertDiffBuffer(var JobLedgerEntry: Record "Job Ledger Entry"; var JobPlanningLine: Record "Job Planning Line"; var JobDiffBuffer: array[2] of Record "Job Difference Buffer" temporary; LineType: Option Schedule,Usage; CurrencyType: Option LCY,FCY)` (integration)
- `OnChangeCurrencyDatesOnBeforeChangeCurrencyDate(var JobPlanningLine: Record "Job Planning Line"; var ForceDateUpdate: Boolean)` (integration)
- `OnBeforeEndCreateInvoice(var NoOfInvoices: Integer; var IsHandled: Boolean)` (integration)

## Procedures

- `SplitLines(var JT2: Record "Job Task"): Integer`
- `TransferToPlanningLine(var JobLedgEntry: Record "Job Ledger Entry"; LineType: Integer)`
- `ChangePlanningDates(JT: Record "Job Task"; ScheduleLine: Boolean; ContractLine: Boolean; PeriodLength: DateFormula; FixedDate: Date; StartingDate: Date; EndingDate: Date)`
- `ChangeCurrencyDates(JT: Record "Job Task"; scheduleLine: Boolean; ContractLine: Boolean; PeriodLength: DateFormula; FixedDate: Date; StartingDate: Date; EndingDate: Date)`
- `ChangeDatesEnd()`
- `CreateJT(JobPlanningLine: Record "Job Planning Line")`
- `InitDiffBuffer()`
- `PostDiffBuffer(DocNo: Code[20]; PostingDate: Date; TemplateName: Code[10]; BatchName: Code[10])`
- `BatchError(PostingDate: Date; DocNo: Code[20])`
- `EndCreateInvoice(NoOfInvoices: Integer)`
- `CalculateActualToBudget(var Job: Record Job; JT: Record "Job Task"; var JobDiffBuffer2: Record "Job Difference Buffer"; var JobDiffBuffer3: Record "Job Difference Buffer"; CurrencyType: Option LCY,FCY)`
- `GetCurrencyCode(var Job: Record Job; Type: Option "0","1","2","3"; CurrencyType: Option "Local Currency","Foreign Currency"): Text[50]`

Plus 2 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 1001 "Job Post-Line"](../codeunit/1001.md) (1 call: `TransferToPlanningLine → InsertPlLineFromLedgEntry`)

## Called by

- [Report 1090 "Job Calc. Remaining Usage"](../report/1090.md) (3 calls: `OnPostReport → PostDiffBuffer`, `OnPreReport → BatchError`, `OnPreReport → InitDiffBuffer`)
- [Report 1093 "Job Create Sales Invoice"](../report/1093.md) (2 calls: `OnPostReport → EndCreateInvoice`, `OnPreReport → BatchError`)
- [Report 1085 "Job Post WIP to G/L"](../report/1085.md) (1 call: `OnPreReport → BatchError`)
- [Report 1086 "Job Calculate WIP"](../report/1086.md) (1 call: `OnPreReport → BatchError`)
- [Report 1091 "Job Transfer To Planning Lines"](../report/1091.md) (1 call: `OnPreReport → TransferToPlanningLine`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-25

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