Codeunit 6987 "Expense Report-Post"
ExpenseAgent · Microsoft.ExpenseAgent
Across versions
- BC23-28not present
- BC29present
- BC30changed
Neighbourhood 24 connected objects and pages
ExpenseAgent · Microsoft.ExpenseAgent · BC29-30 · source at 4e6a307c · facts from BC29
Properties
| Property | Value |
|---|---|
| TableNo | Expense Report Header |
| Permissions | TableData “Expense Report Header” = rimd, TableData “Expense Report Line” = rimd, TableData “Sales Header” = rimd, TableData “Sales Line” = rimd, TableData “Gen. Journal Line” = rimd, TableData “Expense Ledger Entry” = rimd, TableData “Expense Report Line Particip.” = rimd, TableData “Expense Report… |
Events published
OnAfterProcessExpenseReportLine(ExpenseReportHeader: Record "Expense Report Header"; ExpenseReportLine: Record "Expense Report Line"; PostedExpenseReportLine: Record "Posted Expense Report Line"; PostedExpenseReportHeader: Record "Posted Expense Report Header")(integration)- subscribers: Codeunit 7057 “WHT Exp. Report Post Handler” OnAfterProcessExpenseReportLine, Codeunit 7440 “EA Corp Card Post Mgt” OnAfterProcessExpenseReportLine
OnBeforePostEmployeeEntry(var GenJournalLine: Record "Gen. Journal Line"; ExpenseReportHeader: Record "Expense Report Header"; PostedExpenseReportHeader: Record "Posted Expense Report Header")(integration)- subscribers: Codeunit 7057 “WHT Exp. Report Post Handler” OnBeforePostEmployeeEntry
OnAfterPostEmployeeEntry(GenJournalLine: Record "Gen. Journal Line"; ExpenseReportHeader: Record "Expense Report Header"; PostedExpenseReportHeader: Record "Posted Expense Report Header")(integration)- subscribers: Codeunit 7057 “WHT Exp. Report Post Handler” OnAfterPostEmployeeEntry
OnBeforePostExpenseReport(var ExpenseReportHeader: Record "Expense Report Header")(integration): Raised before an expense report is posted, before the built-in posting validation runs and before the posted expense report is created.OnAfterPostExpenseReport(ExpenseReportHeader: Record "Expense Report Header"; PostedExpenseReportHeader: Record "Posted Expense Report Header"; PreviewMode: Boolean)(integration): Raised after an expense report is posted: the posted expense report, its general ledger entries and its expense ledger entries are created. The draft expense report is deleted after this event.OnBeforePostExpenseGenJournalLine(var GenJournalLine: Record "Gen. Journal Line"; ExpenseReportHeader: Record "Expense Report Header"; ExpenseReportLine: Record "Expense Report Line")(integration): Raised before a general journal line for an expense report line is posted. This covers the expense, VAT specification, company-paid, non-refundable and currency rounding lines of the expense report line; the employee entry has its own events.
Event subscriptions
- OnAfterBindSubscription subscribes to Codeunit “Gen. Jnl.-Post Preview” OnAfterBindSubscription
- OnAfterUnbindSubscription subscribes to Codeunit “Gen. Jnl.-Post Preview” OnAfterUnbindSubscription
Procedures
RunWithCheck(var ExpenseReportHeader: Record "Expense Report Header")(internal)PostExpenseReport(var ExpenseReportHeader: Record "Expense Report Header")(internal)UpdateVATAmount(var Amount: Decimal; var AmountLCY: Decimal; var VATAmount: Decimal; var VATAmountLCY: Decimal; var VATBaseAmount: Decimal; var VATBaseAmountLCY: Decimal; ExpenseReportHeader: Record "Expense Report Header"; ExpenseReportLine: Record "Expense Report Line")(internal)SetPreviewMode(NewPreviewMode: Boolean)(internal): Sets the Preview Mode for the current instance of the codeunit. Preview Mode ensures no transactions are committed to the database and no documents are sent.CheckAndSendReimbursementNotification(PostedExpReportHeader: Record "Posted Expense Report Header"): Boolean(internal)
Plus 61 local procedures.
Triggers
OnRun
Relations
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 12 “Gen. Jnl.-Post Line” (9 calls:
InsertExpenseLedgerEntry → GetNextTransactionNo,PostCompanyPaidExpenseJournal → RunWithCheck,PostEmployeeEntry → RunWithCheck, …) - Codeunit 6926 “Expense Activity Log Mgt.” (3 calls:
CheckAndCreatePostedDocument → HasEntriesForSource,CheckAndCreatePostedDocument → LogExpenseReportEventByBCUser,CheckAndCreatePostedDocument → ReassignExpenseReportEntriesToPosted) - Codeunit 6996 “Exp. Preview Posting Handler” (2 calls:
TryBindPostingPreviewHandler → TryBindPostingPreviewHandler,TryUnbindPostingPreviewHandler → TryUnbindPostingPreviewHandler) - Codeunit 1012 “Job Jnl.-Post Line” (1 call:
PostProjectJnlLine → RunWithCheck) - Codeunit 1173 “Document Attachment Mgmt” (1 call:
CopyDocumentAttachment → CopyAttachments) - Codeunit 19 “Gen. Jnl.-Post Preview” (1 call:
RunWithCheck → ThrowError) - Codeunit 27 “Confirm Management” (1 call:
PostExpenseReport → GetResponseOrDefault) - Codeunit 4317 “Agent System Permissions” (1 call:
GetReimbursementSetupErrorInfo → CurrentUserHasCanManageAllAgentsPermission) - Codeunit 6941 “EA Http Client” (1 call:
SendReimbursementNotification → SendReimbursementNotification) - Codeunit 6984 “Release Exp. Report Document” (1 call:
RunWithCheck → (object)) - Codeunit 6994 “Expense Preview Post Instance” (1 call:
TryBindPostingPreviewHandler → Initialize) - Codeunit 7133 “Travel Request Approval” (1 call:
LogTravelRequestsClosedByPosting → LogTravelRequestClosed) - Codeunit 7447 “EA Corp Card Selection Mgt” (1 call:
ValidateExpenseReportLineForPosting → ValidateReportLine) - Codeunit 8703 “Feature Telemetry” (1 call:
LogAgentVATSpecificationUsage → LogUsage) - Page 456 “No. Series” (1 call:
CreatePostedExpenseReport → (object))
Called by
- Codeunit 6997 “Expense Preview Post Mgt.” (2 calls:
OnRunPreview → (object),OnRunPreview → SetPreviewMode) - Codeunit 7442 “EA Create Corp Card Setup” (1 call:
CreateAndPostCsvSampleExpenseReport → RunWithCheck) - Page 6910 “Expense Report” (1 call:
PostDocument → PostExpenseReport) - Page 6980 “Manager Expense Report” (1 call:
PostDocument → PostExpenseReport) - Page 6997 “Expense Reports” (1 call:
PostDocument → PostExpenseReport) - Table 6907 “Expense Report Line” (1 call:
UpdateVATAmount → UpdateVATAmount)
Recent changes
- 2026-11-26 #14528 Deliverable 660629: [29.x] BCApps part of No Receipt expenses (releases/29.x, BC29, feature)
- 2026-11-26 #13671 Expense Agent: configure posting groups per subcategory (main, BC30, feature)
- 2026-11-23 #14346 [Main] Expense Management: add partner extension events and make Create Expense Report public (main, BC30, feature)
- 2026-11-20 #14335 [Main] Expense Management: make Expense Management Setup public; keep agent and corporate card surface internal (main, BC30, feature)
- 2026-11-20 #14295 [Main] Expense Management: make core expense business objects public (main, BC30, feature)
- 2026-11-20 #12544 Slice 626931: [Expense Agent] Lost receipt workflow and document creation (November ’26) (main, BC30, feature)
- 2026-11-17 #14022 [Expense Agent] Travel request fixes: deletion after cancel, linked reports, approver audit user, closure history (main, BC30, fix)
- 2026-11-16 #13587 Update Corp Card manual selection (main, BC30, feature)
- 2026-11-11 #13760 [Expense Agent] Allow receipt submission with unresolved VAT setup (main, BC30, fix)
- 2026-11-03 #12985 [Master] - Bug 654115: [Expense Agent] Cannot submit report with a non-refundable Employee Paid line: ‘nothing to refund’ blocks release, report stuck in draft (main, BC30, fix)
- 2026-10-28 #12147 Bugs/add corp card basics (main, BC30, feature)
- 2026-10-02 #12074 Expense Agent: travel request expense location, per-traveler reports, activity log and submitter comment (main, BC30, feature)
- 2026-08-31 #10312 Update expense VAT specification source (main, BC30, feature)
- 2026-08-28 #10637 [Master] - Bug 639548 [Expense Agent] Consolidate country demo data into single W1 app (main, BC30, refactor)
- 2026-08-26 #10631 Integration/main to releases 29.x 31a860b5 (releases/29.x, BC29, feature)
- 2026-08-21 #10031 Add AI-assisted policy evaluation backend to Expense Agent (main, BC30, feature)
- 2026-08-17 #10255 Add expense activity history foundation (main, BC30, feature)
- 2026-08-17 #9973 [WHT]-Withholding Tax is not deducted from Expense Report lines based on the Expense Category during posting (main, BC30, fix)
- 2026-08-10 #9391 [Master] - Slice 616928: [Expense Management] [App part] Expense Managements Travel Requisitions 💸 (main, BC30, feature)
- 2026-08-04 #9859 [Master] - Move Expense Agent (Preview) app into BCApps (main, BC30, feature, added)
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Post the year-end closing entry — possibly related: Posts expense reports and generates year-end closing entries through general journal posting. (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). 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: "Expense Report-Post"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.