---
id: object/codeunit/4037
type: object
title: Codeunit 4037 "Helper Functions"
summary: Codeunit 4037 "Helper Functions" in HybridGP (Microsoft.DataMigration.GP). 73 public procedures, 7 events. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - hybridgp
versions:
  introduced: "29"
  last_changed: null
  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: e489b0276599624f57f6816b397c0e20ba4f303c5e6f26eb2d03abd37dd333ea
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/HybridGP/app/src/Migration/Support/HelperFunctions.codeunit.al
    title: src/Apps/W1/HybridGP/app/src/Migration/Support/HelperFunctions.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/9363
object_type: codeunit
object_id: 4037
name: Helper Functions
namespace: Microsoft.DataMigration.GP
app: HybridGP
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 134
  events: 7
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 16
  called_by: 14
  implements: 0
---

# Codeunit 4037 "Helper Functions"

> Codeunit 4037 "Helper Functions" in HybridGP (Microsoft.DataMigration.GP). 73 public procedures, 7 events. Introduced in BC29, still in BC30.

HybridGP · Microsoft.DataMigration.GP · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/HybridGP/app/src/Migration/Support/HelperFunctions.codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Permissions | tabledata "Dimension Set Entry" = rimd, tabledata "G/L Account" = rimd, tabledata "G/L Entry" = rimd, tabledata Customer = rimd, tabledata "Cust. Ledger Entry" = rimd, tabledata Dimension = rimd, tabledata "Dimension Value" = rimd, tabledata "Detailed Cust. Ledg. Entry" = rimd, tabledata Vendor = ri... |

## Events published

- `OnSkipPostingGLAccounts(var SkipPosting: Boolean)` (integration)
- `OnSkipPostingAccountBatches(var SkipPosting: Boolean)` (integration)
- `OnSkipPostingCustomerBatches(var SkipPosting: Boolean)` (integration)
- `OnSkipPostingVendorBatches(var SkipPosting: Boolean)` (integration)
- `OnSkipPostingBankBatches(var SkipPosting: Boolean)` (integration)
- `OnSkipPostingItemBatches(var SkipPosting: Boolean)` (integration)
- `OnHandlePaymentTerm(GPPaymentTerms: Record "GP Payment Terms"; var IsPaymentTermHandled: Boolean)` (integration)

## Procedures

- `GetTextFromJToken(JToken: JsonToken; Path: Text): Text`
- `WriteTextToField(var DestinationFieldRef: FieldRef; TextToWrite: Text)`
- `GetFileNameByEntityName(EntityName: Text): Text`
- `UpdateFieldValue(var RecordVariant: Variant; FieldNo: Integer; JObject: JsonObject; PropertyName: Text)`
- `UpdateFieldWithValue(var RecordVariant: Variant; FieldNo: Integer; Value: Text[30])`
- `TrimStringQuotes(Value: Text): Text`
- `GetPostingAccountNumber(AccountToGet: Text): Code[20]`
- `ConvertAccountCategory(GPAccount: Record "GP Account"): Option`
- `ConvertDebitCreditType(GPAccount: Record "GP Account"): Option`
- `ConvertIncomeBalanceType(GPAccount: Record "GP Account"): Option`
- `CreateCountryIfNeeded(CountryCode: Code[10]; CountryName: Text[50])`
- `AssignSubAccountCategory(GPAccount: Record "GP Account"): Integer`
- `TrimBackslash(Value: Text): Text`
- `SetCustomerTransType(var GPCustomerTransactions: Record "GP Customer Transactions")`
- `SetVendorTransType(var GPVendorTransactions: Record "GP Vendor Transactions")`
- `ResetAdjustforPaymentInGLSetup(var Flag: Boolean)`
- `RunPreMigrationChecks(): Boolean`
- `CreateDimensions()`
- `CreatePaymentTerms()`
- `CreateItemTrackingCodes()`
- `CreateLocations()`
- `CreateCheckbooks()`
- `CreateOpenPOs()`
- `CreateFiscalPeriods()`
- `CreateVendorEFTBankAccounts()`
- `CreateVendorClasses()`
- `CreateCustomerClasses()`
- `CreateSetupRecordsIfNeeded()`
- `CalculateDueDateFormula(GPPaymentTerms: Record "GP Payment Terms"; Use_Discount_Calc: Boolean; Discount_Calc: Text[32]): Text[50]` (internal)
- `CalculateDiscountDateFormula(GPPaymentTerms: Record "GP Payment Terms"): Text[50]` (internal)
- `GetMigrationTypeTxt(): Text[250]`
- `GetTelemetryCategory(): Text`
- `CheckDimensionName(Name: Text[50]): Code[20]` (internal)
- `CreateDimensionValues()`
- `AnyCompaniesWithTooManySegments(var CompanyList: List of [Text])`
- `SetTransactionProcessedFlag()`
- `HaveGLTrxsBeenProcessed(): Boolean`
- `SetAccountValidationError()`
- `ClearAccountValidationError()`
- `GetAccountValidationError(): Boolean`
- `GetNumberOfAccounts(): Integer`
- `GetNumberOfItems(): Integer`
- `GetNumberOfCustomers(): Integer`
- `GetNumberOfVendors(): Integer`
- `RemoveEmptyGLTransactions()`
- `RaiseNotificationForUnpostedJournals()`
- `GetUnpostedBatchCountForCompany(CompanyNameTxt: Text; var TotalGLBatchCount: Integer; var TotalStatisticalBatchCount: Integer; var TotalBankBatchCount: Integer; var TotalCustomerBatchCount: Integer; var TotalItemBatchCount: Integer; var TotalVendorBatchCount: Integer)` (internal)
- `PostGLTransactions()`
- `LogWarningAndClearLastError(ContextValue: Text[50])` (internal)
- `RemoveBatches()`
- `SetGlobalDimensions(GlobalDim1: Code[20]; GlobalDim2: Code[20])`
- `UpdateGlobalDimensionNo()`
- `SetProcessesRunning(IsRunning: Boolean)`
- `LocationsCreated(): Boolean`
- `GetLastError()`
- `CreatePreMigrationData(): Boolean`
- `CreatePostMigrationData(): Boolean`
- `CheckMigrationStatus()`
- `CleanGPPhoneOrFaxNumber(InValue: Text[30]): Text[21]`
- `ContainsAlphaChars(InValue: Text[30]): Boolean`
- `GetGPAccountNumberByIndex(GPAccountIndex: Integer): Code[20]`
- `EnsureAccountHasGenProdPostingAccount(AccountNumber: Code[20])`
- `CreateCurrencyIfNeeded(CurrencyCode: Code[10])`
- `StringEqualsCaseInsensitive(Text1: Text; Text2: Text): Boolean`
- `CheckAndLogErrors()` (internal)
- `ShouldMigrateItem(ItemNo: Text): Boolean` (internal)
- `RunPreMigrationCleanup()` (internal)
- `CreateDimSet(ACTNUMBR_1: Code[20]; ACTNUMBR_2: Code[20]; ACTNUMBR_3: Code[20]; ACTNUMBR_4: Code[20]; ACTNUMBR_5: Code[20]; ACTNUMBR_6: Code[20]; ACTNUMBR_7: Code[20]; ACTNUMBR_8: Code[20]): Integer` (internal)
- `GetSegmentValue(ACTNUMBR_1: Code[20]; ACTNUMBR_2: Code[20]; ACTNUMBR_3: Code[20]; ACTNUMBR_4: Code[20]; ACTNUMBR_5: Code[20]; ACTNUMBR_6: Code[20]; ACTNUMBR_7: Code[20]; ACTNUMBR_8: Code[20]; SegmentNumber: Integer): Code[20]` (internal)
- `GetSegmentNumbersFromGPAccountIndex(GPAccountIndex: Integer; var ACTNUMBR_1: Code[20]; var ACTNUMBR_2: Code[20]; var ACTNUMBR_3: Code[20]; var ACTNUMBR_4: Code[20]; var ACTNUMBR_5: Code[20]; var ACTNUMBR_6: Code[20]; var ACTNUMBR_7: Code[20]; var ACTNUMBR_8: Code[20]): Code[20]` (internal)
- `AreAllSegmentNumbersEmpty(ACTNUMBR_1: Code[20]; ACTNUMBR_2: Code[20]; ACTNUMBR_3: Code[20]; ACTNUMBR_4: Code[20]; ACTNUMBR_5: Code[20]; ACTNUMBR_6: Code[20]; ACTNUMBR_7: Code[20]; ACTNUMBR_8: Code[20]): Boolean` (internal)
- `CodeIsEmpty(TheCode: Code[20]): Boolean` (internal)
- `GenerateStandardCodeDescriptionFromAccount(var GPAccount: Record "GP Account"): Text` (internal)

Plus 54 local procedures.

## 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 1796 "Data Migration Error Logging"](../codeunit/1796.md) (7 calls: `CreateDimensionsImp → SetLastRecordUnderProcessing`, `CreateLocationsImp → SetLastRecordUnderProcessing`, `CreatePaymentTermsImp → SetLastRecordUnderProcessing`, …)
- [Codeunit 4019 "GP Item Migrator"](../codeunit/4019.md) (2 calls: `CreateItemCategories → CreateItemCategories`, `CreateKitItems → MigrateKitItems`)
- [Codeunit 4022 "GP Vendor Migrator"](../codeunit/4022.md) (2 calls: `CreateVendorEFTBankAccountsImp → MigrateVendorEFTBankAccounts`, `GetNumberOfVendors → ShouldMigrateVendor`)
- [Codeunit 4100 "Temp Blob"](../codeunit/4100.md) (2 calls: `WriteTextToField → CreateOutStream`, `WriteTextToField → ToRecordRef`)
- [Codeunit 570 "G/L Account Category Mgt."](../codeunit/570.md) (2 calls: `GetAcctCategoryEntryNo → GetAccountCategory`, `GetAcctSubCategoryEntryNo → GetAccountSubcategory`)
- [Codeunit 10 "Type Helper"](../codeunit/10.md) (1 call: `WriteTextToField → Evaluate`)
- [Codeunit 13 "Gen. Jnl.-Post Batch"](../codeunit/13.md) (1 call: `SafePostGLBatch → (object)`)
- [Codeunit 23 "Item Jnl.-Post Batch"](../codeunit/23.md) (1 call: `SafePostItemBatch → (object)`)
- [Codeunit 2626 "Stat. Acc. Post. Batch"](../codeunit/2626.md) (1 call: `SafePostStatisticalAccBatch → (object)`)
- [Codeunit 4001 "Hybrid Cloud Management"](../codeunit/4001.md) (1 call: `RaiseNotificationForUnpostedJournals → GetLastReplicationSummary`)
- [Codeunit 40025 "GP Checkbook Migrator"](../codeunit/40025.md) (1 call: `CreateCheckBooksImp → MoveCheckbookStagingData`)
- [Codeunit 40107 "FiscalPeriods"](../codeunit/40107.md) (1 call: `CreateFiscalPeriodsImp → MoveStagingData`)
- [Codeunit 40108 "GP PO Migrator"](../codeunit/40108.md) (1 call: `CreateOpenPOsImp → MigratePOStagingData`)
- [Codeunit 4017 "GP Account Migrator"](../codeunit/4017.md) (1 call: `CreateAllocationAccounts → CreateAllocationAccounts`)
- [Codeunit 408 "DimensionManagement"](../codeunit/408.md) (1 call: `CreateDimSet → GetDimensionSetID`)
- [Codeunit 6112 "Customer Data Migration Facade"](../codeunit/6112.md) (1 call: `CreateCountryIfNeeded → CreateCountryIfNeeded`)

## Called by

- [Codeunit 4022 "GP Vendor Migrator"](../codeunit/4022.md) (24 calls: `CreateOrUpdateOrderAddress → CleanGPPhoneOrFaxNumber`, `CreateOrUpdateRemitAddress → CleanGPPhoneOrFaxNumber`, `CreateRecurringPurchaseLineImp → CreateDimSet`, …)
- [Codeunit 4018 "GP Customer Migrator"](../codeunit/4018.md) (19 calls: `CreateCustomerPostingGroupIfNeeded → EnsureAccountHasGenProdPostingAccount`, `CreateCustomerPostingGroupIfNeeded → GetGPAccountNumberByIndex`, `CreateCustomerPostingGroupIfNeeded → GetPostingAccountNumber`, …)
- [Codeunit 4025 "GP Cloud Migration"](../codeunit/4025.md) (17 calls: `CreateDataMigrationStatusRecords → GetMigrationTypeTxt`, `InitiateGPMigration → CreatePreMigrationData`, `InitiateGPMigration → CreateSetupRecordsIfNeeded`, …)
- [Codeunit 4017 "GP Account Migrator"](../codeunit/4017.md) (15 calls: `CreateFixedAllocationAccountDistribution → CreateDimSet`, `CreateGLAccountBeginningBalanceImp → AreAllSegmentNumbersEmpty`, `CreateGLAccountBeginningBalanceImp → CreateDimSet`, …)
- [Codeunit 4035 "Wizard Integration"](../codeunit/4035.md) (14 calls: `OnAfterMigrationFinishedSubscriber → SetProcessesRunning`, `OnCreatePostMigrationDataSubscriber → CheckAndLogErrors`, `OnCreatePostMigrationDataSubscriber → CreatePostMigrationData`, …)
- [Codeunit 40903 "GP Migration Validator"](../codeunit/40903.md) (11 calls: `GetUnpostedBatchCounts → GetUnpostedBatchCountForCompany`, `RunCustomerValidation → CleanGPPhoneOrFaxNumber`, `RunCustomerValidation → ContainsAlphaChars`, …)
- [Codeunit 4019 "GP Item Migrator"](../codeunit/4019.md) (7 calls: `ApplyGenPostingSetupCommonAccounts → GetPostingAccountNumber`, `CanAddGenProductPostingAccount → GetGPAccountNumberByIndex`, `CreateDefaultInventoryPostingGroup → GetPostingAccountNumber`, …)
- [Codeunit 4016 "Hybrid GP Management"](../codeunit/4016.md) (3 calls: `HandleInitializationOfGPSynchronization → GetTelemetryCategory`, `TriggerUpgradeIfOneStepEnabled → GetTelemetryCategory`, `UpdateStatusOnHybridReplicationCompleted → GetTelemetryCategory`)
- [Table 4026 "GP Payment Terms"](../table/4026.md) (2 calls: `GetCalculatedDateForumla → CalculateDiscountDateFormula`, `GetCalculatedDateForumla → CalculateDueDateFormula`)
- [Codeunit 40025 "GP Checkbook Migrator"](../codeunit/40025.md) (1 call: `GetBankAccPostingAccountNumber → GetTelemetryCategory`)
- [Codeunit 40108 "GP PO Migrator"](../codeunit/40108.md) (1 call: `CreateLines → ShouldMigrateItem`)
- [Codeunit 4015 "Hybrid GP Wizard"](../codeunit/4015.md) (1 call: `BeforeShowProductSpecificSettingsPageStep → AnyCompaniesWithTooManySegments`)
- [Codeunit 4033 "Install GP SmartLists"](../codeunit/4033.md) (1 call: `InstallGPSmartListsExtension → GetTelemetryCategory`)
- [Page 40125 "Hybrid GP Overview Fb"](../page/40125.md) (1 call: `OnAfterGetCurrRecord → GetUnpostedBatchCountForCompany`)

## Recent changes

- 2026-09-11 [#9363 GP - Updates 202607](../../changes/bcapps/9363.md) (main, BC30, fix)

## Across versions

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

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