---
id: object/codeunit/308
type: object
title: Codeunit 308 "No. Series - Batch"
summary: Codeunit 308 "No. Series - Batch" in Business Foundation (Microsoft.Foundation.NoSeries). 16 public procedures. Introduced in BC24, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - business foundation
versions:
  introduced: "24"
  last_changed: null
  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: f341c1436d9f8d4392d16597065fd839846d03e34f6f1923a93f56839a742f4a
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Business%20Foundation/App/NoSeries/src/Batch/NoSeriesBatch.Codeunit.al
    title: src/Business Foundation/App/NoSeries/src/Batch/NoSeriesBatch.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: 308
name: No. Series - Batch
namespace: Microsoft.Foundation.NoSeries
app: Business Foundation
extends: null
first_version: "24"
last_version: "30"
present_in:
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 16
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 2
  called_by: 25
  implements: 0
---

# Codeunit 308 "No. Series - Batch"

> Codeunit 308 "No. Series - Batch" in Business Foundation (Microsoft.Foundation.NoSeries). 16 public procedures. Introduced in BC24, still in BC30.

Business Foundation · Microsoft.Foundation.NoSeries · BC24-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Business%20Foundation/App/NoSeries/src/Batch/NoSeriesBatch.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Public |

## Procedures

- `GetNextNo(NoSeriesCode: Code[20]): Code[20]`: Get the next number in the No. Series. This function finds the first valid No. Series line based on WorkDate and calls the No. Series Line implementation to get the next number. Defaults UsageDate to WorkDate.
- `GetNextNo(NoSeriesCode: Code[20]; UsageDate: Date): Code[20]`: Get the next number in the No. Series. This function finds the first valid No. Series line based on UsageDate and calls the No. Series Line implementation to get the next number.
- `GetNextNo(var NoSeriesLine: Record "No. Series Line"; UsageDate: Date): Code[20]`: Get the next number in the No. Series. This function uses the specified No. Series line and calls the No. Series Line implementation to get the next number.
- `GetNextNo(NoSeriesCode: Code[20]; UsageDate: Date; HideErrorsAndWarnings: Boolean): Code[20]`: Get the next number in the No. Series. This function finds the first valid No. Series line based on UsageDate and calls the No. Series Line implementation to get the next number.
- `GetNextNo(var NoSeriesLine: Record "No. Series Line"; UsageDate: Date; HideErrorsAndWarnings: Boolean): Code[20]`: Get the next number in the No. Series. This function uses the specified No. Series line and calls the No. Series Line implementation to get the next number.
- `PeekNextNo(NoSeriesCode: Code[20]): Code[20]`: Get the next number in the No. Series, without incrementing the number. This function finds the first valid No. Series line based on WorkDate and calls the No. Series Line implementation to peek the next number. Defaults UsageDate to WorkDate.
- `PeekNextNo(NoSeriesCode: Code[20]; UsageDate: Date): Code[20]`: Get the next number in the No. Series, without incrementing the number. This function finds the first valid No. Series line based on UsageDate and calls the No. Series Line implementation to peek the next number.
- `PeekNextNo(NoSeriesLine: Record "No. Series Line"; UsageDate: Date): Code[20]`: Get the next number in the No. Series, without incrementing the number. This function uses the specified No. Series line and calls the No. Series Line implementation to peek the next number.
- `GetLastNoUsed(NoSeriesCode: Code[20]): Code[20]`: Get the last number used in the No. Series.
- `GetLastNoUsed(var NoSeriesLine: Record "No. Series Line"): Code[20]`: Get the last number used in the No. Series.
- `TestManual(NoSeriesCode: Code[20])`: Verifies that the No. Series allows using manual numbers.
- `TestManual(NoSeriesCode: Code[20]; DocumentNo: Code[20])`: Verifies that the No. Series allows using manual numbers and throws an error for the document no. if it does not.
- `SimulateGetNextNo(NoSeriesCode: Code[20]; UsageDate: Date; LastNoUsed: Code[20]): Code[20]`: Simulate the specified No. Series at the specified date starting with the indicated number.
- `SetSimulationMode()`: Puts the codeunit in simulation mode which disables the ability to save state.
- `SaveState(TempNoSeriesLine: Record "No. Series Line" temporary)`: Save the state of the No. Series Line to the database.
- `SaveState()`: Save all changes to the database.

## 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 309 "No. Series - Batch Impl."](../codeunit/309.md) (6 calls: `GetLastNoUsed → GetLastNoUsed`, `GetNextNo → GetNextNo`, `PeekNextNo → PeekNextNo`, …)
- [Page 456 "No. Series"](../page/456.md) (1 call: `TestManual → (object)`)

## Called by

- [Codeunit 13 "Gen. Jnl.-Post Batch"](../codeunit/13.md) (5 calls: `CheckDocumentNo → GetNextNo`, `ProcessBalanceOfLines → GetNextNo`, `ProcessBalanceOfLines → PeekNextNo`, …)
- [Codeunit 6213 "Sustainability Jnl.-Post"](../codeunit/6213.md) (4 calls: `ProcessLines → GetNextNo`, `ProcessLines → PeekNextNo`, `ProcessLines → SaveState`, …)
- [Codeunit 6271 "Sust. Excise Jnl.-Post"](../codeunit/6271.md) (4 calls: `ProcessLines → GetNextNo`, `ProcessLines → PeekNextNo`, `ProcessLines → SaveState`, …)
- [Table 81 "Gen. Journal Line"](../table/81.md) (4 calls: `CheckDocNoOnLines → GetNextNo`, `CheckDocNoOnLines → SetSimulationMode`, `CheckDocNoOnLines → TestManual`, …)
- [Codeunit 23 "Item Jnl.-Post Batch"](../codeunit/23.md) (3 calls: `Code → SaveState`, `ConstructPostingNumber → GetNextNo`, `PostLines → GetNextNo`)
- [Codeunit 5633 "FA Jnl.-Post Batch"](../codeunit/5633.md) (3 calls: `CheckFAJnlLineDocumentNo → GetNextNo`, `Code → SaveState`, `PostLines → GetNextNo`)
- [Codeunit 1013 "Job Jnl.-Post Batch"](../codeunit/1013.md) (2 calls: `Code → GetNextNo`, `UpdateAndDeleteLines → SaveState`)
- [Codeunit 213 "Res. Jnl.-Post Batch"](../codeunit/213.md) (2 calls: `Code → GetNextNo`, `Code → SaveState`)
- [Codeunit 5653 "Insurance Jnl.-Post Batch"](../codeunit/5653.md) (2 calls: `Code → GetNextNo`, `Code → SaveState`)
- [Codeunit 6211 "Sustainability Journal Mgt."](../codeunit/6211.md) (2 calls: `GetDocumentNo → PeekNextNo`, `GetDocumentNo → SimulateGetNextNo`)
- [Codeunit 6214 "Sustainability Recur Jnl.-Post"](../codeunit/6214.md) (2 calls: `OnRun → GetNextNo`, `OnRun → SaveState`)
- [Codeunit 6270 "Sust. Excise Journal Mgt."](../codeunit/6270.md) (2 calls: `GetDocumentNo → PeekNextNo`, `GetDocumentNo → SimulateGetNextNo`)
- [Codeunit 6274 "Sust. Excise Cal. Mgt"](../codeunit/6274.md) (2 calls: `InsertExciseJournalLineFromItemLedgerEntry → GetNextNo`, `InsertExciseJournalLineFromPurchaseInvoiceLine → GetNextNo`)
- [Codeunit 7304 "Whse. Jnl.-Register Batch"](../codeunit/7304.md) (2 calls: `Code → GetNextNo`, `Code → SaveState`)
- [Page 39 "General Journal"](../page/39.md) (2 calls: `NewDocumentNo → PeekNextNo`, `NewDocumentNo → SimulateGetNextNo`)
- [Report 394 "Suggest Employee Payments"](../report/394.md) (2 calls: `CopyEmployeeLedgerEntriesToTempEmplPaymentBuffer → SimulateGetNextNo`, `CopyTempEmpPaymentBuffersToGenJnlLines → SimulateGetNextNo`)
- [Codeunit 1224 "Map Incoming Doc to Gen. Line"](../codeunit/1224.md) (1 call: `CreateGeneralJournalLineFromIncomingDocument → GetNextNo`)
- [Codeunit 1400 "DocumentNoVisibility"](../codeunit/1400.md) (1 call: `ForceShowNoSeriesForDocNo → GetNextNo`)
- [Codeunit 5469 "Library API - General Journal"](../codeunit/5469.md) (1 call: `AlterDocNoBasedOnExternalDocNo → SimulateGetNextNo`)
- [Codeunit 7251 "Bank Acc. Rec. Trans. to Acc."](../codeunit/7251.md) (1 call: `GetDocumentNo → GetNextNo`)
- [Codeunit 7412 "Excise Tax Calculation"](../codeunit/7412.md) (1 call: `InitializeExciseJournalLine → GetNextNo`)
- [Codeunit 980 "Payment Registration Mgt."](../codeunit/980.md) (1 call: `Post → GetNextNo`)
- [Page 1190 "Create Payment"](../page/1190.md) (1 call: `SetNextNo → GetNextNo`)
- [Report 393 "Suggest Vendor Payments"](../report/393.md) (1 call: `RunIncrementDocumentNo → SimulateGetNextNo`)
- [Table 6915 "Posted Expense Report Header"](../table/6915.md) (1 call: `OnInsert → GetNextNo`)

## Across versions

- Present in: BC24-30
- Changed (declaration) in: none

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: "No. Series - Batch")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
