---
id: object/codeunit/550
type: object
title: Codeunit 550 "VAT Rate Change Conversion"
summary: Codeunit 550 "VAT Rate Change Conversion" in Base Application (Microsoft.Finance.VAT.RateChange). 15 public procedures, 61 events. Present since at least BC23, still in BC30, changed in BC25, BC28.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "28"
  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: 68b39a3f80635f9004a9069b4dd79772b150b9f5dd9ea7b60b84886b345f18c7
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Finance/VAT/RateChange/VATRateChangeConversion.Codeunit.al
    title: src/Layers/W1/BaseApp/Finance/VAT/RateChange/VATRateChangeConversion.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 550
name: VAT Rate Change Conversion
namespace: Microsoft.Finance.VAT.RateChange
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "25"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 101
  events: 61
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 4
  calls: 2
  called_by: 2
  implements: 0
---

# Codeunit 550 "VAT Rate Change Conversion"

> Codeunit 550 "VAT Rate Change Conversion" in Base Application (Microsoft.Finance.VAT.RateChange). 15 public procedures, 61 events. Present since at least BC23, still in BC30, changed in BC25, BC28.

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

## Properties

| Property | Value |
|---|---|
| Permissions | TableData "VAT Rate Change Log Entry" = i |

## Events published

- `OnAddNewPurchaseLineOnBeforeOldPurchaseLineModify(var OldPurchaseLine: Record "Purchase Line"; var NewPurchaseLine: Record "Purchase Line"; VATProdPostingGroup: Code[20]; GenProdPostingGroup: Code[20])` (integration): Integration event raised before modifying the original purchase line during VAT rate change conversion. Allows custom modifications to both old and new purchase lines before database update.
- `OnAddNewSalesLineOnBeforeOldSalesLineModify(var OldSalesLine: Record "Sales Line"; var NewSalesLine: Record "Sales Line"; VATProdPostingGroup: Code[20]; GenProdPostingGroup: Code[20])` (integration): Integration event raised before modifying the original sales line during VAT rate change conversion. Allows custom modifications to both old and new sales lines before database update.
- `OnAfterInitNewSalesLineFromSalesLine(var NewSalesLine: Record "Sales Line"; SalesLine: Record "Sales Line")` (integration): Integration event raised after initializing a new sales line from an existing sales line during VAT rate change conversion. Allows custom field copying and initialization logic for the new sales line.
- `OnAfterUpdateTables(var VATRateChangeSetup: Record "VAT Rate Change Setup")` (integration): Integration event raised after updating all tables during VAT rate change conversion process. Allows custom post-processing logic after all configured tables have been updated.
  - subscribers: [Codeunit 99000775 "Mfg. VAT Rate Change Mgt."](../codeunit/99000775.md) OnAfterUpdateTables
- `OnAfterConvert(var VATRateChangeSetup: Record "VAT Rate Change Setup")` (integration): Integration event raised after completing the entire VAT rate change conversion process. Allows custom finalization logic and cleanup after all conversion operations.
- `OnAfterLineInScope(GenProdPostingGroup: Code[20]; VATProdPostingGroup: Code[20]; ConvertGenProdPostingGroup: Boolean; ConvertVATProdPostingGroup: Boolean; var Result: Boolean)` (integration): Integration event raised after determining if a line is in scope for VAT rate change conversion. Allows custom logic to modify the scope determination result based on additional criteria.
- `OnAfterAreTablesSelected(var VATRateChangeSetup: Record "VAT Rate Change Setup"; var Result: Boolean)` (integration): Integration event raised after checking if tables are selected for VAT rate change conversion. Allows custom logic to modify table selection validation results.
  - subscribers: [Codeunit 6471 "Serv. VAT Rate Change Conv."](../codeunit/6471.md) OnAfterAreTablesSelected, [Codeunit 99000775 "Mfg. VAT Rate Change Mgt."](../codeunit/99000775.md) OnAfterAreTablesSelected
- `OnBeforeCheckPurchaseLinePartlyShipped(var PurchaseLine: Record "Purchase Line"; var DescriptionTxt: Text[250]; var IsHandled: Boolean)` (integration): Integration event raised before checking if a purchase line is partly shipped during VAT rate change validation. Allows custom validation logic for purchase line shipping status.
- `OnBeforeCheckSalesLinePartlyShipped(var SalesLine: Record "Sales Line"; var DescriptionTxt: Text[250]; var IsHandled: Boolean)` (integration): Integration event raised before checking if a sales line is partly shipped during VAT rate change validation. Allows custom validation logic for sales line shipping status.
- `OnBeforeConvert(var VATRateChangeSetup: Record "VAT Rate Change Setup")` (integration): Integration event raised before starting the VAT rate change conversion process. Allows custom initialization and validation logic before conversion begins.
- `OnBeforeFinishConvert(var VATRateChangeSetup: Record "VAT Rate Change Setup"; var ProgressWindow: Dialog)` (integration): Integration event raised before finishing the VAT rate change conversion process. Allows custom cleanup and finalization logic before closing the conversion operation.
  - subscribers: [Codeunit 6471 "Serv. VAT Rate Change Conv."](../codeunit/6471.md) OnBeforeFinishConvert
- `OnBeforeOnRun(var IsHandled: Boolean)` (integration): Integration event raised before running the VAT rate change conversion codeunit. Allows custom logic to override or enhance the main conversion process execution.
- `OnBeforeUpdateGLAccount(var GLAccount: Record "G/L Account"; var VATRateChangeSetup: Record "VAT Rate Change Setup"; var IsHandled: Boolean)` (integration): Integration event raised before updating G/L account records during VAT rate change conversion. Allows custom validation and modification logic for G/L account updates.
- `OnBeforeUpdateItem(var Item: Record Item; var VATRateChangeSetup: Record "VAT Rate Change Setup"; var IsHandled: Boolean)` (integration): Integration event raised before updating item records during VAT rate change conversion. Allows custom validation and modification logic for item updates.
- `OnBeforeUpdateResource(var Resource: Record Resource; var VATRateChangeSetup: Record "VAT Rate Change Setup"; var IsHandled: Boolean)` (integration): Integration event raised before updating resource records during VAT rate change conversion. Allows custom validation and modification logic for resource updates.
- `OnBeforeUpdateSales(var VATRateChangeSetup: Record "VAT Rate Change Setup"; var IsHandled: Boolean; var SalesHeader: Record "Sales Header")` (integration): Integration event raised before updating sales documents during VAT rate change conversion. Allows custom validation and preprocessing logic for sales document updates.
- `OnBeforeUpdateTable(TableID: Integer; ConvertVATProdPostingGroup: Boolean; ConvertGenProdPostingGroup: Boolean; var IsHandled: Boolean)` (integration): Integration event raised before updating a specific table during VAT rate change conversion. Allows custom logic to override or enhance table-specific update processing.
- `OnBeforeUpdatePurchase(var VATRateChangeSetup: Record "VAT Rate Change Setup"; var IsHandled: Boolean; var PurchaseHeader: Record "Purchase Header")` (integration): Integration event raised before updating purchase documents during VAT rate change conversion. Allows custom validation and preprocessing logic for purchase document updates.
- `OnBeforeUpdateRec(var RecRef: RecordRef; ConvertVATProdPostingGroup: Boolean; ConvertGenProdPostingGroup: Boolean; var IsHandled: Boolean)` (integration): Integration event raised before updating a record during VAT rate change conversion. Allows custom validation and preprocessing logic for individual record updates.
- `OnConvertOnBeforeStartConvert(var VATRateChangeSetup: Record "VAT Rate Change Setup")` (integration): Integration event raised before starting the conversion process within the main convert operation. Allows custom initialization and validation logic at the beginning of the conversion workflow.
- `OnAfterAddNewSalesLine(var OldSalesLine: Record "Sales Line"; var NewSalesLine: Record "Sales Line")` (integration): Integration event raised after adding a new sales line during VAT rate change conversion. Allows custom post-processing logic for the newly created sales line.
- `OnAfterAddNewPurchaseLine(var OldPurchaseLine: Record "Purchase Line"; var NewPurchaseLine: Record "Purchase Line")` (integration): Integration event raised after adding a new purchase line during VAT rate change conversion. Allows custom post-processing logic for the newly created purchase line.
- `OnUpdatePurchaseOnAfterPurchaseHeaderSetFilters(var PurchaseHeader: Record "Purchase Header")` (integration): Integration event raised after setting filters on purchase headers during purchase document update. Allows custom filter modifications for purchase header processing.
- `OnUpdatePurchaseOnAfterPurchaseLineSetFilters(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header")` (integration): Integration event raised after setting filters on purchase lines during purchase document update. Allows custom filter modifications for purchase line processing.
- `OnUpdateRecOnBeforeRecRefModify(var RecRef: RecordRef; GenProdPostingGroupConverted: Boolean; VATProdPostingGroupConverted: Boolean)` (integration): Integration event raised before modifying a record reference during VAT rate change conversion. Allows custom logic before database modification occurs.
- `OnUpdateRecOnAfterRecRefModify(var RecRef: RecordRef; GenProdPostingGroupConverted: Boolean; VATProdPostingGroupConverted: Boolean)` (integration): Integration event raised after modifying a record reference during VAT rate change conversion. Allows custom post-processing logic after database modification.
- `OnUpdateSalesOnAfterSalesHeaderSetFilters(VATRateChangeSetup: Record "VAT Rate Change Setup"; var SalesHeader: Record "Sales Header")` (integration): Integration event raised after setting filters on sales headers during sales document update. Allows custom filter modifications for sales header processing.
- `OnUpdateSalesOnAfterSalesLineSetFilters(VATRateChangeSetup: Record "VAT Rate Change Setup"; SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")` (integration)
- `OnUpdateSalesOnAfterModifySalesLine(var SalesLine: Record "Sales Line"; IsModified: Boolean; VATRateChangeSetup: Record "VAT Rate Change Setup"; SalesHeader: Record "Sales Header"; SalesLineOld: Record "Sales Line")` (integration)
- `OnUpdateSalesOnAfterUpdateSalesLines(VATRateChangeSetup: Record "VAT Rate Change Setup"; var SalesHeader: Record "Sales Header"; ConvertVATProdPostingGroup: Boolean; ConvertGenProdPostingGroup: Boolean)` (integration)
- `OnUpdatePurchaseOnAfterResetPurchaseHeaderStatus(var PurchaseHeader: Record "Purchase Header")` (integration)
- `OnUpdatePurchaseOnAfterCalcShouldProcessLine(var PurchaseLine: Record "Purchase Line"; var ShouldProcessLine: Boolean)` (integration)
- `OnUpdateSalesOnAfterResetSalesHeaderStatus(var SalesHeader: Record "Sales Header")` (integration)
- `OnUpdateSalesOnBeforeModifySalesLine(var SalesLine: Record "Sales Line"; var IsModified: Boolean)` (integration)
- `OnUpdatePurchaseOnBeforeModifyPurchaseLine(var PurchaseLine: Record "Purchase Line"; var IsModified: Boolean)` (integration)
- `OnAddNewPurchaseLineOnAfterInsertNewLine(var PurchaseLine: Record "Purchase Line"; var NewPurchaseLine: Record "Purchase Line")` (integration)
- `OnAddNewPurchaseLineOnBeforeInsertNewLine(var PurchaseLine: Record "Purchase Line"; var NewPurchaseLine: Record "Purchase Line")` (integration)
- `OnAddNewSalesLineOnAfterInsertNewLine(var SalesLine: Record "Sales Line"; var NewSalesLine: Record "Sales Line")` (integration)
- `OnUpdateSalesOnBeforeChangeSalesLine(var SalesLine: Record "Sales Line")` (integration)
- `OnUpdatePurchaseOnBeforeChangePurchaseLine(var PurchaseLine: Record "Purchase Line")` (integration)
- `OnUpdatePurchaseBlanketOrderOnBeforeChangeBlanketOrder(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnUpdateSalesBlanketOrderOnBeforeChangeBlanketOrder(var SalesLine: Record "Sales Line"; var IsHandled: Boolean)` (integration)
- `OnUpdatePurchaseOnAfterOpenPurchaseHeader(var PurchaseHeader: Record "Purchase Header")` (integration)
- `OnUpdateSalesOnAfterOpenSalesHeader(var SalesHeader: Record "Sales Header")` (integration)
- `OnUpdatePurchaseOnAfterUpdatePurchaseLines(VATRateChangeSetup: Record "VAT Rate Change Setup"; var PurchaseHeader: Record "Purchase Header"; ConvertVATProdPostingGroup: Boolean; ConvertGenProdPostingGroup: Boolean)` (integration)
- `OnTestVATPostingSetupOnAfterVATPostingSetupOldSetFilters(var VATPostingSetupOld: Record "VAT Posting Setup"; VATRateChangeSetup: Record "VAT Rate Change Setup")` (integration)
- `OnUpdateRecOnBeforeValidateGenProdPostingGroup(var RecRef: RecordRef; FldRef: FieldRef; VatRateChangeConversion: Record "VAT Rate Change Conversion"; var IsHandled: Boolean)` (integration)
- `OnAddNewPurchaseLineOnAfterNewPurchaseLineInit(var OldPurchaseLine: Record "Purchase Line"; var NewPurchaseLine: Record "Purchase Line")` (integration)
- `OnUpdatePurchaseOnAfterPurchaseLineModify(VATRateChangeSetup: Record "VAT Rate Change Setup"; PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; PurchaseLineOld: Record "Purchase Line")` (integration)
- `OnIncludePurchLineOnTypeElse(Type: Enum "Purchase Line Type"; var Result: Boolean; var IsHandled: Boolean)` (integration)
- `OnIncludeSalesLineOnTypeElse(Type: Enum "Sales Line Type"; var Result: Boolean; var IsHandled: Boolean)` (integration)
- `OnCanUpdatePurchaseOnAfterLoopIteration(var DescriptionTxt: Text[250]; PurchaseLine: Record "Purchase Line")` (integration)
- `OnCanUpdatePurchaseOnAfterPurchaseLineSetFilters(var PurchaseLine: Record "Purchase Line")` (integration)
- `OnCanUpdateSalesOnAfterLoopIteration(var DescriptionTxt: Text[250]; SalesLine: Record "Sales Line")` (integration)
- `OnCanUpdateSalesOnAfterSalesLineSetFilters(var SalesLine: Record "Sales Line")` (integration)
- `OnBeforeDoUpdatePurchaseLine(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; var CanUpdate: Boolean)` (integration)
- `OnBeforeDoUpdateSalesLine(SalesLine: Record "Sales Line"; var IsHandled: Boolean; var CanUpdate: Boolean)` (integration)
- `OnBeforeCanUpdateSales(SalesHeader: Record "Sales Header"; ConvertVATProdPostingGroup: Boolean; ConvertGenProdPostingGroup: Boolean; var IsHandled: Boolean; var CanUpdate: Boolean)` (integration)
- `OnBeforeCanUpdatePurchase(PurchaseHeader: Record "Purchase Header"; ConvertGenProdPostingGroup: Boolean; ConvertVATProdPostingGroup: Boolean; var IsHandled: Boolean; var CanUpdate: Boolean)` (integration)
- `OnBeforeAddNewSalesLine(SalesLine: Record "Sales Line"; VATProdPostingGroup: Code[20]; GenProdPostingGroup: Code[20]; var IsHandled: Boolean)` (integration)
- `OnBeforeAddNewPurchaseLine(PurchaseLine: Record "Purchase Line"; VATProdPostingGroup: Code[20]; GenProdPostingGroup: Code[20]; var IsHandled: Boolean)` (integration)

## Procedures

- `ConvertVATProdPostGrp(UpdateOption: Option): Boolean`: Determines whether VAT product posting groups should be converted based on the update option.
- `ConvertGenProdPostGrp(UpdateOption: Option): Boolean`: Determines whether general product posting groups should be converted based on the update option.
- `UpdateTable(TableID: Integer; ConvertVATProdPostingGroup: Boolean; ConvertGenProdPostingGroup: Boolean)`: Updates all records in a specified table with new VAT or general product posting groups.
- `UpdateRec(var RecRef: RecordRef; ConvertVATProdPostingGroup: Boolean; ConvertGenProdPostingGroup: Boolean)`: Updates posting group fields in a specific record and creates log entries for the changes.
- `WriteLogEntry(VATRateChangeLogEntry: Record "VAT Rate Change Log Entry")`: Inserts a log entry for VAT rate change conversion tracking.
- `AddNewSalesLine(SalesLine: Record "Sales Line"; VATProdPostingGroup: Code[20]; GenProdPostingGroup: Code[20])`: Creates a new sales line with updated posting groups when document lines need to be split during conversion. Handles complex scenarios with reservations, item charges, and blanket orders.
- `UpdatePurchase()`: Updates purchase documents with new VAT and general product posting groups during conversion. Handles document status changes, line splitting, and complex validation scenarios.
- `GetNextPurchaseLineNo(PurchaseLine: Record "Purchase Line"; var NextLineNo: Integer): Boolean`: Calculates the next available line number for a new purchase line.
- `UpdateUnitPriceInclVAT(Type: Enum "Sales Line Type"): Boolean`: Determines whether unit price including VAT should be updated for the specified sales line type. Uses setup configuration to control which line types require price updates during VAT rate changes.
- `LineInScope(GenProdPostingGroup: Code[20]; VATProdPostingGroup: Code[20]; ConvertGenProdPostingGroup: Boolean; ConvertVATProdPostingGroup: Boolean): Boolean`: Determines whether a record is in scope for conversion based on its posting group values.
- `GetNextSalesLineNo(SalesLine: Record "Sales Line"; var NextLineNo: Integer): Boolean`: Calculates the next available line number for inserting a new sales line in the same document. Uses spacing logic to insert between existing lines when possible, or appends with standard increment.
- `GetRoundingPrecision(CurrencyCode: Code[10]): Decimal`: Retrieves the unit amount rounding precision for the specified currency. Handles both local currency (empty code) and foreign currency scenarios with proper precision lookup.
- `IncludeSalesLine(Type: Enum "Sales Line Type"; No: Code[20]): Boolean`: Determines whether a sales line with the specified type and number should be included in VAT rate change processing. Validates line inclusion based on setup configuration and posting group assignments.
- `IncludePurchLine(Type: Enum "Purchase Line Type"; No: Code[20]): Boolean`: Determines whether a purchase line with the specified type and number should be included in VAT rate change processing. Validates line inclusion based on setup configuration and posting group assignments.
- `InitVATRateChangeLogEntry(var VATRateChangeLogEntry: Record "VAT Rate Change Log Entry"; RecRef: RecordRef; OutstandingQuantity: Decimal; LineNo: Integer)`: Initializes a VAT rate change log entry with standard tracking information for a record conversion. Sets up logging data including record identification, table reference, and status description.

Plus 25 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 5402 "Unit of Measure Management"](../codeunit/5402.md) (2 calls: `AddNewPurchaseLine → QtyRndPrecision`, `AddNewSalesLine → QtyRndPrecision`)
- [Codeunit 5777 "Whse. Validate Source Line"](../codeunit/5777.md) (2 calls: `CheckPurchaseLinePartlyShipped → WhseLinesExist`, `CheckSalesLinePartlyShipped → WhseLinesExist`)

## Called by

- [Codeunit 6471 "Serv. VAT Rate Change Conv."](../codeunit/6471.md) (13 calls: `AddNewServiceLine → ConvertGenProdPostGrp`, `AddNewServiceLine → ConvertVATProdPostGrp`, `AddNewServiceLine → GetRoundingPrecision`, …)
- [Codeunit 99000775 "Mfg. VAT Rate Change Mgt."](../codeunit/99000775.md) (3 calls: `OnAfterUpdateTables → ConvertGenProdPostGrp`, `OnAfterUpdateTables → ConvertVATProdPostGrp`, `OnAfterUpdateTables → UpdateTable`)

## Across versions

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

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: "VAT Rate Change Conversion")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
