---
id: object/codeunit/8125
type: object
title: Codeunit 8125 "Report Filename Mgt."
summary: Codeunit 8125 "Report Filename Mgt." in ReportFilenameManager (Microsoft.Foundation.Reporting.FileNaming). 41 public procedures. Introduced in BC30.
tier: official
language: en
tags:
  - codeunit
  - reportfilenamemanager
versions:
  introduced: "30"
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-11-01T00:36:06.569Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 5ce61409ec018a656bd110a23c3e9f26d9a16a79c83d7763bf628d9c75b5597c
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/d2abc1d2ceae394331716c8183ef60e1534c2ce0/src/Apps/W1/ReportFilenameManager/app/src/codeunit/ReportFilenameMgt.Codeunit.al
    title: src/Apps/W1/ReportFilenameManager/app/src/codeunit/ReportFilenameMgt.Codeunit.al (main)
    date: null
    commit: d2abc1d2ceae394331716c8183ef60e1534c2ce0
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/12610
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-sign-extension
      title: Sign an app package file
      label: possibly related
      why: Report filename management codeunit for signing app package files.
      by: model
object_type: codeunit
object_id: 8125
name: Report Filename Mgt.
namespace: Microsoft.Foundation.Reporting.FileNaming
app: ReportFilenameManager
extends: null
first_version: "30"
last_version: "30"
present_in:
  - "30"
changed_in: []
source_major: "30"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 111
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 0
  called_by: 0
  implements: 0
---

# Codeunit 8125 "Report Filename Mgt."

> Codeunit 8125 "Report Filename Mgt." in ReportFilenameManager (Microsoft.Foundation.Reporting.FileNaming). 41 public procedures. Introduced in BC30.

ReportFilenameManager · Microsoft.Foundation.Reporting.FileNaming · BC30 · [source at d2abc1d2](https://github.com/microsoft/BCApps/blob/d2abc1d2ceae394331716c8183ef60e1534c2ce0/src/Apps/W1/ReportFilenameManager/app/src/codeunit/ReportFilenameMgt.Codeunit.al) · facts from BC30

## Properties

| Property | Value |
|---|---|
| Access | Public |
| Permissions | tabledata "Report Filename Pattern" = r, tabledata "Report Filename Setup" = r |

## Procedures

- `TryResolve(ReportId: Integer; Channel: Enum "Report Filename Output Route"; var SourceRecRef: RecordRef; FilterViews: Text; var Filename: Text): Boolean`: Resolves a file name for a report delivery. Returns false when no pattern applies or any placeholder cannot be resolved, in which case the caller keeps the name it already had.
- `IsActive(): Boolean`: Whether the feature is switched on and at least one pattern exists. Subscribers ask this first, so that with the feature off the app adds no reads a user might lack permission for.
- `TryResolveNaming(ReportId: Integer; Channel: Enum "Report Filename Output Route"; var DocumentRecRef: RecordRef; var Winner: Record "Report Filename Pattern"; var Filename: Text): Boolean` (internal): The name a document would be given, together with the pattern that won, so Test Pattern can tell an administrator when a more specific pattern beats theirs.
- `FallbackName(ReportId: Integer): Text` (internal): The report's caption, which Test Pattern shows as the name when no route rule gives one.
- `IsNamedByReminderCommunication(var DocumentRecRef: RecordRef): Boolean` (internal): Whether Reminder Communication names any reminder in this run, in which case the whole run is left to it on every route. It subscribes to the same naming events, in unspecified order, so yielding keeps the result independent of subscriber order. Temporary: copies Reminder Communication's rule (FindF...
- `TryResolveWithPattern(var Pattern: Record "Report Filename Pattern"; ReportId: Integer; var DocumentRecRef: RecordRef; var Filename: Text): Boolean` (internal): The name one particular pattern produces, without choosing between patterns.
- `SubjectTableNo(ReportId: Integer): Integer` (internal): The table a run is about: the first data item when it is a real table, otherwise the shallowest real table among the data items (some reports, such as 910 Posted Assembly Order, start with the virtual Integer table), otherwise zero.
- `SubjectTableNo(var ReportMetadata: Record "Report Metadata"): Integer` (internal): Overload for callers that already hold the metadata, to avoid re-reading it per report.
- `ReportsAboutTable(TableNo: Integer): Text` (internal): The reports whose subject is this table, as a filter on Report Metadata's ID. Report 25 is checked on its own because its subject is not among its data items.
- `SubjectViewOf(ReportId: Integer; TableNo: Integer): Text` (internal): The table view a report declares on its subject (for example Standard Sales - Quote reads only quotes), so records offered for testing are ones the report can see. Taken from the shallowest data item over the table, as SubjectFromDataItems picks it.
- `IsNamableTable(TableNo: Integer): Boolean` (internal): Excludes system tables and obsolete tables whose fields the placeholder picker does not offer.
- `FirstUnmetCriterion(var Candidate: Record "Report Filename Pattern"; ReportId: Integer; Channel: Enum "Report Filename Output Route"; var DocumentRecRef: RecordRef; var DocumentLanguageCode: Code[10]): Enum "Report Filename Criterion"` (internal): For Test Pattern: the first criterion not met, by the same rules used at delivery.
- `NameLanguage(var Pattern: Record "Report Filename Pattern"; var DocumentRecRef: RecordRef): Code[10]` (internal)
- `TryFindPlaceholderWithoutValue(var Pattern: Record "Report Filename Pattern"; ReportId: Integer; var DocumentRecRef: RecordRef; ShapesOnly: Boolean; var PlaceholderText: Text): Boolean` (internal): The first placeholder without a value, as the administrator wrote it. The binding keeps the pattern text's placeholder order, so the position maps back to the text.
- `TryShapeName(var Pattern: Record "Report Filename Pattern"; var Filename: Text): Boolean` (internal): The name in the Example File Name part, built from value shapes rather than a real document: there may be no data, no permission to read it, or it may be sensitive. Finished with the same sanitiser and length limit as a real name.
- `TryShapeName(var Pattern: Record "Report Filename Pattern"; OverManyRecords: Boolean; var Filename: Text): Boolean` (internal): True for the first-to-last range shape of a run over many records.
- `TryShapeNameListed(var Pattern: Record "Report Filename Pattern"; var Filename: Text): Boolean` (internal): The shape of a run over a few records (up to Max. Values Named): values listed rather than collapsed to first-to-last.
- `RangeJoinOf(var Pattern: Record "Report Filename Pattern"): Text` (internal): What goes between the first and last value of a range. A blank Range Word is a valid choice and leaves just the separator.
- `TryFindComputedPlaceholder(CanonicalName: Text; var PlaceholderImplementation: Interface "Report Filename Placeholder"): Boolean` (internal)
- `TryFindComputedPlaceholder(PlaceholderName: Text; AcceptDisplayName: Boolean; var PlaceholderImplementation: Interface "Report Filename Placeholder"): Boolean` (internal): Walks the placeholder enum, including values added by extensions.
- `FormatPatternDecimal(Value: Decimal; var OwnerRecRef: RecordRef): Text` (internal): To the document currency's decimal places, with an invariant separator and no grouping: the session's format region would otherwise make the same amount read differently per user.
- `FormatPatternDate(Value: Date; DateFormat: Enum "Report Filename Date Format"): Text` (internal)
- `FormatSampleDate(DateFormat: Enum "Report Filename Date Format"): Text` (internal)
- `FormatSampleDate(DateFormat: Enum "Report Filename Date Format"; Last: Boolean): Text` (internal): The later sample is a month on, so the two ends differ in every offered format except Year, where they differ only in December.
- `SampleDecimalText(): Text` (internal)
- `SampleDecimalText(Last: Boolean): Text` (internal)
- `IsUsableSeparator(Value: Text): Boolean` (internal): Narrower than Sanitise: a separator sits mid-name, so leading or trailing spaces and periods (as in " - ") are allowed.
- `DisallowedCharacters(): Text` (internal)
- `Sanitise(Value: Text): Text` (internal): GetSafeFileName removes only what the server's OS rejects (on Unix just null and /), so every device's invalid characters are removed as well. Unusual but legal characters such as &amp; or ~ are kept, which is why StripNotsupportChrInFileName is not used.
- `WhyNameIsRefused(Value: Text; var CutName: Text): Enum "Report Filename Refusal"` (internal): For Test Pattern: why FinishName refuses a name, judged in the same order.
- `TryBuildUnfinishedName(var Pattern: Record "Report Filename Pattern"; ReportId: Integer; var DocumentRecRef: RecordRef; var Resolved: Text): Boolean` (internal): As TryResolveWithPattern, but before FinishName sanitises and cuts the name.
- `MaxFileNameLengthInUse(): Integer` (internal)
- `RemoveCharsEveryDeviceRejects(Value: Text): Text` (internal): Windows' invalid characters and control characters 1-31 (also invalid on FAT and exFAT), DEL (rejected by Android's FileUtils.isValidFatFilenameChar), and # and % (reserved in OneDrive for work or school).
- `NotifyIfSwitchedOff(): Boolean` (internal)
- `OpenSetupFromNotification(SetupNotification: Notification)` (internal): Re-sends the notification if patterns are still off, since choosing the action dismissed it.
- `FinishName(Value: Text; MaxLength: Integer): Text` (internal): Checked again after the cut, which can leave a reserved name ("CON - x" becomes CON) or nothing.
- `FitWithEnding(Name: Text; Ending: Text; MaxLength: Integer): Text` (internal): Shortens the name, never the ending (extension, or number and extension).
- `BusinessCentralsDocumentFileName(DocumentType: Text; DocumentNo: Code[20]; Extension: Code[3]): Text[250]` (internal): Business Central's default document file name, rebuilt from a copy of Electronic Document Format.GetAttachmentFileName's format: calling it would raise OnBeforeGetAttachmentFileName and could return another extension's name. Extension lower case as version 30 writes it (29 wrote upper case). Tempora...
- `IsBusinessCentralsDefaultName(CurrentName: Text; DocumentType: Text; DocumentNo: Code[20]; Extension: Code[3]): Boolean` (internal): Whether a name is still Business Central's default. The extension is compared in either case, because version 29 writes it upper case and version 30 lower case.
- `IsBusinessCentralsDefaultName(CurrentName: Text; DocumentType: Text; DocumentNo: Code[20]; Extension: Code[3]; var WrittenExtension: Text): Boolean` (internal): Receives the extension as written in the current name, without its dot; blank when the name is not Business Central's or the 250-character cut removed it. True when nothing has changed the name since Business Central built it.
- `FitToDevices(Value: Text; Limit: Integer): Text` (internal): File systems allow 255 bytes (ext4) or 255 UTF-16 characters (NTFS, FAT32, exFAT, HFS+ after decomposition), so a character above 127 counts as 4, the most UTF-8 bytes a character takes. Surrogate pairs are never split.

Plus 70 local procedures.

## Recent changes

- 2026-10-27 [#12610 [Report Filename Manager] New app for configurable report output file names - Slice 651696 [vendor work]](../../changes/bcapps/12610.md) (main, BC30, feature, added)

## Across versions

- Present in: BC30
- Changed (declaration) in: none

## Possibly related

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

- [Sign an app package file](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-sign-extension) — possibly related: Report filename management codeunit for signing app package files. (model-linked)

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). 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: "Report Filename Mgt.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
