---
id: object/codeunit/5605
type: object
title: Codeunit 5605 "Calculate Disposal"
summary: Codeunit 5605 "Calculate Disposal" in Base Application (Microsoft.FixedAssets.FixedAsset). 8 public procedures, 10 events. Present since at least BC23, still in BC30, changed in BC25-26, BC29.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "29"
  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: 66b4cad1100e4437e009cd0e24189ad891bbf9fdd233f4386ad97d0d628e1f95
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/FixedAssets/FixedAsset/CalculateDisposal.Codeunit.al
    title: src/Layers/W1/BaseApp/FixedAssets/FixedAsset/CalculateDisposal.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/fr
    - localization/ru
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 5605
name: Calculate Disposal
namespace: Microsoft.FixedAssets.FixedAsset
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "25"
  - "26"
  - "29"
source_major: "29"
obsolete: null
countries:
  - fr
  - ru
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 20
  events: 10
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 1
  called_by: 2
  implements: 0
---

# Codeunit 5605 "Calculate Disposal"

> Codeunit 5605 "Calculate Disposal" in Base Application (Microsoft.FixedAssets.FixedAsset). 8 public procedures, 10 events. Present since at least BC23, still in BC30, changed in BC25-26, BC29.

Base Application · Microsoft.FixedAssets.FixedAsset · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/FixedAssets/FixedAsset/CalculateDisposal.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Permissions | TableData "FA Ledger Entry" = r, TableData "Maintenance Ledger Entry" = r |

## Events published

- `OnCalcGainLossOnAfterSetEntryAmounts(FANo: Code[20]; DeprBookCode: Code[10]; var EntryAmounts: array[14] of Decimal)` (integration)
- `OnAfterSetEntryAmountsOnBeforeGainLoss(FANo: Code[20]; FADeprBook: Record "FA Depreciation Book"; DeprBookCode: Code[10]; var EntryAmounts: array[14] of Decimal; var GainLoss: Decimal; var IsHandled: Boolean)` (integration)
- `OnAfterGetDisposalMethod(var DisposalMethod: Option " ",Net,Gross)` (integration)
- `OnCalcSecondGainLossAfterCalcFieldGainLoss(var FADeprBook: Record "FA Depreciation Book")` (integration)
- `OnCalcReverseAmountsBeforeSetEntryAmounts(FANo: Code[20]; DeprBookCode: Code[10]; var EntryAmounts: array[4] of Decimal; BookValueAmounts: array[4] of Decimal; var IsHandled: Boolean)` (integration)
- `OnBeforeCalcGainLoss(FANo: Code[20]; DeprBookCode: Code[10]; var EntryAmounts: array[14] of Decimal)` (integration)
- `OnAfterSetFAPostingType(i: Integer; var FALedgerEntry: Record "FA Ledger Entry")` (integration)
- `OnAfterSetFAPostingCategory(i: Integer; var FALedgerEntry: Record "FA Ledger Entry")` (integration)
- `OnGetDisposalTypeSetOnAfterSetFilterFALedgEntry(var FALedgerEntry: Record "FA Ledger Entry")` (integration)
- `OnGetErrorDisposalOnAfterSetFilterFALedgEntry(var FALedgerEntry: Record "FA Ledger Entry")` (integration)

## Procedures

- `CalcGainLoss(FANo: Code[20]; DeprBookCode: Code[10]; var EntryAmounts: array[14] of Decimal)`
- `CalcSecondGainLoss(FANo: Code[20]; DeprBookCode: Code[10]; LastDisposalPrice: Decimal; var EntryAmounts: array[14] of Decimal)`
- `CalcReverseAmounts(FANo: Code[20]; DeprBookCode: Code[10]; var EntryAmounts: array[4] of Decimal)`
- `GetDisposalType(FANo: Code[20]; DeprBookCode: Code[10]; ErrorNo: Integer; var DisposalType: Option FirstDisposal,SecondDisposal,ErrorDisposal,LastErrorDisposal; var DisposalMethod: Option " ",Net,Gross; var MaxDisposalNo: Integer; var SalesEntryNo: Integer)`
- `GetErrorDisposal(FANo: Code[20]; DeprBookCode: Code[10]; OnlyGainLoss: Boolean; MaxDisposalNo: Integer; var EntryAmounts: array[14] of Decimal; var EntryNumbers: array[14] of Integer)`
- `SetFAPostingType(i: Integer): Integer`
- `SetFALedgerPostingCategory(i: Integer): Enum "FA Ledger Posting Category"`
- `SetReverseType(i: Integer): Integer`

Plus 2 local procedures.

## Triggers

OnRun

## 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 5616 "Depreciation Calculation"](../codeunit/5616.md) (5 calls: `CalcGainLoss → CalcEntryAmounts`, `CalcGainLoss → GetPartOfCalculation`, `CalcReverseAmounts → CalcEntryAmounts`, …)

## Called by

- [Codeunit 5632 "FA Jnl.-Post Line"](../codeunit/5632.md) (8 calls: `PostDisposalEntry → CalcGainLoss`, `PostDisposalEntry → CalcSecondGainLoss`, `PostDisposalEntry → GetDisposalType`, …)
- [Report 5607 "Fixed Asset - Projected Value"](../report/5607.md) (1 call: `CalculateGainLoss → CalcGainLoss`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC25-26, BC29

## Countries that replace it

[FR](../../localizations/fr.md), [RU](../../localizations/ru.md)

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