---
id: object/codeunit/6987
type: object
title: Codeunit 6987 "Expense Report-Post"
summary: Codeunit 6987 "Expense Report-Post" in ExpenseAgent (Microsoft.ExpenseAgent). 5 public procedures, 3 events, 2 event subscribers. Introduced in BC29, still in BC30, changed in BC30.
tier: official
language: en
tags:
  - codeunit
  - expenseagent
versions:
  introduced: "29"
  last_changed: "30"
  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: e3e28881cdc385ca5af7cb4739bd60167976015ad7a1cb198c7a342923f0776d
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/ExpenseAgent/app/src/ExpenseReport/Codeunits/ExpenseReportPost.Codeunit.al
    title: src/Apps/W1/ExpenseAgent/app/src/ExpenseReport/Codeunits/ExpenseReportPost.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/12074
    - change/bcapps/10312
    - change/bcapps/10637
    - change/bcapps/10631
    - change/bcapps/10031
    - change/bcapps/10255
    - change/bcapps/9973
    - change/bcapps/9391
    - change/bcapps/9859
object_type: codeunit
object_id: 6987
name: Expense Report-Post
namespace: Microsoft.ExpenseAgent
app: ExpenseAgent
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in:
  - "30"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 64
  events: 3
  subscribers: 2
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 3
  calls: 12
  called_by: 5
  implements: 0
---

# Codeunit 6987 "Expense Report-Post"

> Codeunit 6987 "Expense Report-Post" in ExpenseAgent (Microsoft.ExpenseAgent). 5 public procedures, 3 events, 2 event subscribers. Introduced in BC29, still in BC30, changed in BC30.

ExpenseAgent · Microsoft.ExpenseAgent · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/ExpenseAgent/app/src/ExpenseReport/Codeunits/ExpenseReportPost.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Internal |
| 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"](../codeunit/7057.md) 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"](../codeunit/7057.md) 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"](../codeunit/7057.md) OnAfterPostEmployeeEntry

## 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")`
- `SetPreviewMode(NewPreviewMode: Boolean)`: 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 54 local procedures.

## Triggers

OnRun

## Relations

- runs on [Table 6906 "Expense Report Header"](../table/6906.md)

## 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"](../codeunit/12.md) (9 calls: `InsertExpenseLedgerEntry → GetNextTransactionNo`, `PostCompanyPaidExpenseJournal → RunWithCheck`, `PostEmployeeEntry → RunWithCheck`, …)
- [Codeunit 6926 "Expense Activity Log Mgt."](../codeunit/6926.md) (3 calls: `CheckAndCreatePostedDocument → HasEntriesForSource`, `CheckAndCreatePostedDocument → LogExpenseReportEventByBCUser`, `CheckAndCreatePostedDocument → ReassignExpenseReportEntriesToPosted`)
- [Codeunit 6996 "Exp. Preview Posting Handler"](../codeunit/6996.md) (2 calls: `TryBindPostingPreviewHandler → TryBindPostingPreviewHandler`, `TryUnbindPostingPreviewHandler → TryUnbindPostingPreviewHandler`)
- [Codeunit 1012 "Job Jnl.-Post Line"](../codeunit/1012.md) (1 call: `PostProjectJnlLine → RunWithCheck`)
- [Codeunit 1173 "Document Attachment Mgmt"](../codeunit/1173.md) (1 call: `CopyDocumentAttachment → CopyAttachments`)
- [Codeunit 19 "Gen. Jnl.-Post Preview"](../codeunit/19.md) (1 call: `RunWithCheck → ThrowError`)
- [Codeunit 27 "Confirm Management"](../codeunit/27.md) (1 call: `PostExpenseReport → GetResponseOrDefault`)
- [Codeunit 6941 "EA Http Client"](../codeunit/6941.md) (1 call: `SendReimbursementNotification → SendReimbursementNotification`)
- [Codeunit 6984 "Release Exp. Report Document"](../codeunit/6984.md) (1 call: `RunWithCheck → (object)`)
- [Codeunit 6994 "Expense Preview Post Instance"](../codeunit/6994.md) (1 call: `TryBindPostingPreviewHandler → Initialize`)
- [Codeunit 8703 "Feature Telemetry"](../codeunit/8703.md) (1 call: `LogAgentVATSpecificationUsage → LogUsage`)
- [Page 456 "No. Series"](../page/456.md) (1 call: `CreatePostedExpenseReport → (object)`)

## Called by

- [Codeunit 6997 "Expense Preview Post Mgt."](../codeunit/6997.md) (2 calls: `OnRunPreview → (object)`, `OnRunPreview → SetPreviewMode`)
- [Page 6910 "Expense Report"](../page/6910.md) (1 call: `PostDocument → PostExpenseReport`)
- [Page 6980 "Manager Expense Report"](../page/6980.md) (1 call: `PostDocument → PostExpenseReport`)
- [Page 6997 "Expense Reports"](../page/6997.md) (1 call: `PostDocument → PostExpenseReport`)
- [Table 6907 "Expense Report Line"](../table/6907.md) (1 call: `UpdateVATAmount → UpdateVATAmount`)

## Recent changes

- 2026-10-02 [#12074 Expense Agent: travel request expense location, per-traveler reports, activity log and submitter comment](../../changes/bcapps/12074.md) (main, BC30, feature)
- 2026-08-31 [#10312 Update expense VAT specification source](../../changes/bcapps/10312.md) (main, BC30, feature)
- 2026-08-28 [#10637 [Master] - Bug 639548 [Expense Agent] Consolidate country demo data into single W1 app](../../changes/bcapps/10637.md) (main, BC30, refactor)
- 2026-08-26 [#10631 Integration/main to releases 29.x 31a860b5](../../changes/bcapps/10631.md) (releases/29.x, BC29, feature)
- 2026-08-21 [#10031 Add AI-assisted policy evaluation backend to Expense Agent](../../changes/bcapps/10031.md) (main, BC30, feature)
- 2026-08-17 [#10255 Add expense activity history foundation](../../changes/bcapps/10255.md) (main, BC30, feature)
- 2026-08-17 [#9973 [WHT]-Withholding Tax is not deducted from Expense Report lines based on the Expense Category during posting](../../changes/bcapps/9973.md) (main, BC30, fix)
- 2026-08-10 [#9391 [Master] - Slice 616928: [Expense Management] [App part] Expense Managements Travel Requisitions 💸](../../changes/bcapps/9391.md) (main, BC30, feature)
- 2026-08-04 [#9859 [Master] - Move Expense Agent (Preview) app into BCApps](../../changes/bcapps/9859.md) (main, BC30, feature, added)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: BC30

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.
