Codeunit 8127 "Report Filename Context"
ReportFilenameManager · Microsoft.Foundation.Reporting.FileNaming
Across versions
- BC23-29not present
- BC30present
ReportFilenameManager · Microsoft.Foundation.Reporting.FileNaming · BC30 · source at d2abc1d2 · facts from BC30
Properties
| Property | Value |
|---|---|
| Access | Internal |
| SingleInstance | true |
Procedures
SetRenderedDocument(var SourceRecRef: RecordRef; ReportId: Integer)(internal): The incoming report id, never a substitution result.StartAttachAsPdf()(internal): Attach as PDF saves inside Report Selections.SaveAsDocumentAttachment; Document Attachment’s save event is raised for ordinary uploads (Upload file) too.EndAttachAsPdf()(internal)ArmAttachAsPdf(Document: RecordId; ReportId: Integer; var Output: Codeunit "Temp Blob")(internal): Arms the naming of the one attachment Attach as PDF is about to save, for this document and this rendered output. Ignored outside the operation.TryTakeAttachAsPdfArm(Document: RecordId; var Content: Codeunit "Temp Blob"; var ReportId: Integer): Boolean(internal): Whether the attachment being saved now is the one Attach as PDF armed: same document and same content. The arm is taken whatever the answer, so it names one save at most.GetRenderedDocumentReportId(): Integer(internal): The email hook is given a document number and a usage, not the report, and a Report Selections lookup ignores a customer’s Custom Report Selection.GetRenderedDocument(var SourceRecRef: RecordRef): Boolean(internal)ClearLastRendered()(internal): Keeps a document set aside by HoldRenderedDocument.HoldRenderedDocument()(internal): Reminder automation renders the reminder, then asks for and renders each invoice it attaches, and only then asks for the reminder’s name. Only the first document is held, so an invoice cannot take the reminder’s place.GetHeldDocument(var SourceRecRef: RecordRef; var ReportId: Integer): Boolean(internal)ClearHeldDocument()(internal)SetRunSubject(var Subject: RecordRef; ReportId: Integer)(internal): Records what a run is about when the run never says (Financial Reporting: report 25 holds the financial report in a variable). Recorded before the render, which may be cancelled, so it is taken rather than read and cleared when the request page closes on Cancel.HasRunSubjectFor(ReportId: Integer): Boolean(internal): Exactly this report: an interactive run, not a scheduled export’s subject (report zero).SetRunSubjectPeriod(FirstDate: Date; LastDate: Date)(internal): Belongs to the subject: recording a new subject, or clearing it, forgets the period too.NoteTransferValues(FirstDate: Date; LastDate: Date; HiddenDateFilter: Text)(internal): Always the latest call: report 25 calls TransferValues as its request page opens and again from OnPreReport, so when the page closes the latest is the opening.NotePeriodDatesValidated()(internal)MarkStartDateAlwaysOn()(internal): Report 25 was given SetFinancialReportName without SetAccSchedName, so Starting Date stays on whatever the columns are.TryGetRequestPageState(var FirstDate: Date; var LastDate: Date; var HiddenDateFilter: Text; var DatesValidated: Boolean; var FollowsColumns: Boolean): Boolean(internal): Receives whether the columns can switch Starting Date off.TryGetNamingPeriod(var DocumentRecRef: RecordRef; var FirstDate: Date; var LastDate: Date): Boolean(internal): Keyed to the record the period was captured for, so it cannot name any other.ClearNamingPeriod()(internal): Called by Report Filename Mgt.TryResolve after every name, so a period lives for one name.TryTakeRunSubject(ReportId: Integer; var Subject: RecordRef): Boolean(internal): Forgets the subject whether or not it matched, so the next render of any report cannot inherit it.TryPeekRunSubject(ReportId: Integer; var Subject: RecordRef): Boolean(internal): For the scheduled export, which inserts one Report Inbox row per recipient from one render. Interactive naming takes the subject instead (TryTakeRunSubject).ClearRunSubjectFor(ReportId: Integer)(internal)ArmExcelExport()(internal): The overview’s Open in Excel arms one run of report 29: the subject is used only while report 29 runs as the next report.StartExcelExportRun()(internal): Report 29 started any other way (e.g. Fin. Report Excel Templates) forgets the subject.EndExcelExportRun()(internal)NoteReportRun(ReportId: Integer)(internal): Any report other than 29 means an Excel export that failed half way left its state behind; it is forgotten before it could name another workbook.IsExcelExportRunning(): Boolean(internal)ClearExportSubject()(internal): Forgets only an export’s subject (report zero), which lives until the export finishes.ClearRunSubject()(internal): Also called when the request page closes on Cancel, since the subject is recorded before it opens.SetPendingFile(var Document: RecordRef; ReportId: Integer; DocumentType: Text; Channel: Enum "Report Filename Output Route")(internal): For a vendor’s Send to Disk and the “PDF & Electronic Document” zip: the event of Electronic Document Format.GetAttachmentFileName carries neither the report nor the selection row.TryTakePendingFile(var Document: RecordRef; var ReportId: Integer; var DocumentType: Text; var Channel: Enum "Report Filename Output Route"): Boolean(internal): Forgets the file whether or not it is wanted, so one file’s report can never name another.NoteExtensionCasing(LowerCased: Boolean)(internal): The case Business Central wrote an electronic document’s extension in, so the PDF in the same “PDF & Electronic Document” zip can match it. Kept for the session: Base Application 29 writes it upper case, 30 lower case. Removed by ask 8 (a public way to read the name Electronic Document Format.Ge…TryGetExtensionCasing(var LowerCased: Boolean): Boolean(internal)ForgetExtensionCasing()(internal): FOR TESTS ONLY - the app never calls this. The case is held for the session in this SingleInstance codeunit, so only this can reset it for a test of the lower-case fallback.SetSending(var Documents: RecordRef; Usage: Enum "Report Selection Usage"; ToCustomer: Boolean; PartnerNo: Code[20]; PartnerFieldNo: Integer)(internal): For the electronic document: SendElectronically’s events carry the document but not the report selection usage, which is known only where the send begins.ClearSending()(internal)TryGetSending(var Document: RecordRef; var Usage: Enum "Report Selection Usage"; var ToCustomer: Boolean; var PartnerNo: Code[20]): Boolean(internal): Only for a document the send’s filter selects, so one send can never name another’s file.MarkServiceDelivery(Document: RecordId)(internal): VANDocumentReport hands the file name to the electronic document service’s delivery codeunit, so the naming hook leaves that name unchanged for this document.IsServiceDelivery(Document: RecordId): Boolean(internal)ClearServiceDelivery()(internal)SetKindOfDocumentLanguageField(TableNo: Integer; LanguageFieldNo: Integer)(internal): For the length of one [Kind of Document] request, so the OnGetDocumentLanguageCodeCaseElse subscriber in Report Filename Subscribers can tell Business Central the document’s language.TryGetKindOfDocumentLanguageField(TableNo: Integer; var LanguageFieldNo: Integer): Boolean(internal)ClearKindOfDocumentLanguageField()(internal)StartBatch()(internal): A batch is the files of one loop over a document’s report selections (one zip, or one Send to Disk) or of one SendElectronically call; a new name must not repeat one in it.IsNameInBatch(FileName: Text): Boolean(internal): Ignores case, as Windows compares file names.AddNameToBatch(FileName: Text)(internal)
Plus 5 local procedures.
Recent changes
- 2026-10-27 #12610 [Report Filename Manager] New app for configurable report output file names - Slice 651696 [vendor work] (main, BC30, feature, added)
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 Context"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.