---
id: object/codeunit/5342
type: object
title: Codeunit 5342 "CRM Synch. Helper"
summary: Codeunit 5342 "CRM Synch. Helper" in Base Application (Microsoft.Integration.Dataverse). 70 public procedures, 18 events. Present since at least BC23, still in BC30, changed in BC24, BC26-27.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "27"
  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: aebac129f0a17cab117fb86df39a5071d553258bcbeb3eb4a7f7e897d09fcac9
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Integration/D365Sales/CRMSynchHelper.Codeunit.al
    title: src/Layers/W1/BaseApp/Integration/D365Sales/CRMSynchHelper.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/es
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 5342
name: CRM Synch. Helper
namespace: Microsoft.Integration.Dataverse
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "26"
  - "27"
source_major: "29"
obsolete: null
countries:
  - es
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 130
  events: 18
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 7
  calls: 10
  called_by: 19
  implements: 0
---

# Codeunit 5342 "CRM Synch. Helper"

> Codeunit 5342 "CRM Synch. Helper" in Base Application (Microsoft.Integration.Dataverse). 70 public procedures, 18 events. Present since at least BC23, still in BC30, changed in BC24, BC26-27.

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

## Properties

| Property | Value |
|---|---|
| Permissions | TableData "Sales Invoice Header" = m |

## Events published

- `OnAfterGetFieldRelation(RecRef: RecordRef; FldRef: FieldRef; var TableID: Integer)` (integration)
- `OnGetCDSBaseCurrencyId(var BaseCurrencyId: Guid; var handled: Boolean)` (integration)
  - subscribers: [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) HandleOnGetCDSBaseCurrencyId
- `OnGetCDSOwnershipModel(var OwnershipModel: Option; var handled: Boolean)` (integration)
  - subscribers: [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) HandleOnGetCDSOwnershipModel
- `OnGetCDSBaseCurrencySymbol(var BaseCurrencySymbol: Text[5]; var handled: Boolean)` (integration)
  - subscribers: [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) HandleOnGetCDSBaseCurrencySymbol
- `OnGetCDSBaseCurrencyPrecision(var BaseCurrencyPrecision: Integer; var handled: Boolean)` (integration)
  - subscribers: [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) HandleOnGetCDSBaseCurrencyPrecision
- `OnGetCDSCurrencyDecimalPrecision(var CurrencyDecimalPrecision: Integer; var handled: Boolean)` (integration)
  - subscribers: [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) HandleOnGetCDSCurrencyDecimalPrecision
- `OnGetVendorSyncEnabled(var Enabled: Boolean)` (integration)
  - subscribers: [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) HandleOnGetVendorSyncEnabled
- `OnGetIsContactBusinessRelationOptional(var Optional: Boolean)` (integration)
- `OnGetIsContactTypeCheckIgnored(var Ignored: Boolean)` (integration)
- `OnFindAndSynchRecordIDFromIntegrationSystemId(IntegrationSystemId: Guid; TableId: Integer; var LocalRecordID: RecordID; var IsHandled: Boolean)` (integration)
  - subscribers: [Codeunit 7237 "Master Data Mgt. Subscribers"](../codeunit/7237.md) OnFindAndSynchRecordIDFromIntegrationSystemId
- `OnUpdateCRMInvoiceStatusFromEntryOnBeforeModify(var CRMInvoice: Record "CRM Invoice"; var NewCRMInvoice: Record "CRM Invoice"; CustLedgerEntry: Record "Cust. Ledger Entry")` (integration)
- `OnUpdateCRMInvoiceStatusFromEntryOnBeforeCheckFieldsChanged(var CRMInvoice: Record "CRM Invoice"; var NewCRMInvoice: Record "CRM Invoice"; CustLedgerEntry: Record "Cust. Ledger Entry"; var ChangeNeeded: Boolean)` (integration)
- `OnBeforeCalculateActualStatusCode(CustLedgerEntry: Record "Cust. Ledger Entry"; var CRMInvoice: Record "CRM Invoice"; var IsHandled: Boolean)` (integration)
- `OnConvertOptionToTableOnBeforeSetRangeForIntegrationFieldID(var CRMOptionMapping: Record "CRM Option Mapping"; SourceFieldRef: FieldRef; var IsHandled: Boolean)` (integration)
- `OnCancelCRMInvoiceOnBeforeModifyCRMInvoice(var CRMInvoice: Record "CRM Invoice"; var NewCRMInvoice: Record "CRM Invoice")` (integration)
- `OnCancelCRMInvoiceOnBeforeCheckFieldsChanged(var CRMInvoice: Record "CRM Invoice"; var NewCRMInvoice: Record "CRM Invoice"; var ChangeNeeded: Boolean)` (integration)
- `OnBeforeFulfillSalesOrder(var SalesOrderId: Guid)` (integration)
- `OnFailedFindContactByAccountId(DestinationContactRecordRef: RecordRef; var CompanyContact: Record Contact; AccountID: Guid; var OutOfMapFilter: Boolean; var Result: Boolean)` (integration)

## Procedures

- `ClearCache()`
- `GetDefaultPriceListName(): Text[100]`
- `CreateCRMPricelevelInCurrency(var CRMPricelevel: Record "CRM Pricelevel"; CurrencyCode: Code[10]; NewExchangeRate: Decimal)`
- `CreateCRMPriceList(SalesHeader: Record "Sales Header"; var CRMPricelevel: Record "CRM Pricelevel")`
- `UpdateCRMPriceList(SalesHeader: Record "Sales Header"; CRMPricelevelId: Guid)`
- `CreateCRMProductpricelevelForProductAndUom(CRMProduct: Record "CRM Product"; NewPriceLevelId: Guid; CRMUom: Record "CRM Uom")`
- `CreateCRMProductpriceIfAbsent(CRMInvoicedetail: Record "CRM Invoicedetail")`
- `FindCRMDefaultPriceList(var CRMPricelevel: Record "CRM Pricelevel")`
- `FindCRMPriceListByCurrencyCode(var CRMPricelevel: Record "CRM Pricelevel"; CurrencyCode: Code[10]): Boolean`
- `FindCRMProductPriceFromCRMInvoicedetail(CRMInvoicedetail: Record "CRM Invoicedetail"): Boolean`
- `FindNAVLocalCurrencyInCRM(var CRMTransactioncurrency: Record "CRM Transactioncurrency"): Guid`
- `GetBaseCurrencyPrecision(): Decimal`
- `GetCRMCurrencyDefaultPrecision(): Integer`
- `GetCRMLCYToFCYExchangeRate(ToCurrencyISOCode: Text[10]): Decimal`
- `GetFCYtoFCYExchangeRate(FromFCY: Code[10]; ToFCY: Code[10]): Decimal`
- `GetUnitGroupName(UnitOfMeasureCode: Text): Text[200]`
- `GetUnitOfMeasureName(UnitOfMeasureRecordRef: RecordRef): Text[100]`
- `SetCRMDecimalsSupportedValue(var CRMProduct: Record "CRM Product")`
- `SetCRMDefaultPriceListOnProduct(var CRMProduct: Record "CRM Product"): Boolean`
- `SetCRMProductStateToActive(var CRMProduct: Record "CRM Product")`
- `SetCRMProductStateToRetired(var CRMProduct: Record "CRM Product")`
- `SetContactParentCompany(AccountID: Guid; DestinationContactRecordRef: RecordRef): Boolean`
- `SynchRecordIfMappingExists(TableNo: Integer; IntegrationTableNo: Integer; PrimaryKey: Variant): Boolean`
- `SynchRecordIfMappingExists(TableNo: Integer; IntegrationTableNo: Integer; PrimaryKey: Variant; var OutOfMapFilter: Boolean): Boolean`
- `UpdateCRMCurrencyIdIfChanged(CurrencyCode: Text; var DestinationCurrencyIDFieldRef: FieldRef): Boolean`
- `UpdateCRMInvoiceStatus(var CRMInvoice: Record "CRM Invoice"; SalesInvoiceHeader: Record "Sales Invoice Header")`
- `CancelCRMInvoice(var CRMInvoice: Record "CRM Invoice"): Integer` (internal)
- `UpdateCRMInvoiceStatusFromEntry(var CRMInvoice: Record "CRM Invoice"; CustLedgerEntry: Record "Cust. Ledger Entry"): Integer`
- `UpdateCRMPriceListItem(var CRMProduct: Record "CRM Product"): Boolean`
- `UpdateCRMPriceListItems(var CRMProduct: Record "CRM Product"): Boolean`
- `UpdateCRMPriceListItemForUom(var CRMProduct: Record "CRM Product"; CRMUom: Record "CRM Uom"): Boolean`
- `UpdateCRMProductPriceIfNegative(var CRMProduct: Record "CRM Product"): Boolean`
- `UpdateCRMProductQuantityOnHandIfNegative(var CRMProduct: Record "CRM Product"): Boolean`
- `UpdateCRMProductTypeCodeIfChanged(var CRMProduct: Record "CRM Product"; NewProductTypeCode: Integer): Boolean`
- `UpdateCRMProductStateCodeIfChanged(var CRMProduct: Record "CRM Product"; NewBlocked: Boolean): Boolean`
- `UpdateItemBlockedIfChanged(var Item: Record Item; NewBlocked: Boolean): Boolean`
- `UpdateResourceBlockedIfChanged(var Resource: Record Resource; NewBlocked: Boolean): Boolean`
- `UpdateCRMProductUoMFieldsIfChanged(var CRMProduct: Record "CRM Product"; UnitOfMeasureCode: Code[10]): Boolean`
- `UpdateCRMProductUomscheduleId(var CRMProduct: Record "CRM Product"; SourceRecordRef: RecordRef): Boolean`
- `UpdateCRMProductVendorNameIfChanged(var CRMProduct: Record "CRM Product"): Boolean`
- `UpdateOwnerIfChanged(SourceRecordRef: RecordRef; DestinationRecordRef: RecordRef; SourceSalespersonCodeFieldNo: Integer; DestinationOwnerFieldNo: Integer; DestinationOwnerTypeFieldNo: Integer; DestinationOwnerTypeValue: Option): Boolean`
- `UpdateContactOnModifyCustomer(RecRef: RecordRef)`
- `UpdateContactOnModifyVendor(RecRef: RecordRef)`
- `FindOpportunityRelatedCustomer(SourceRecordRef: RecordRef; var ContactBusinessRelation: Record "Contact Business Relation"): Boolean` (internal)
- `FindContactRelatedCustomer(SourceRecordRef: RecordRef; var ContactBusinessRelation: Record "Contact Business Relation"): Boolean`
- `FindContactRelatedVendor(SourceRecordRef: RecordRef; var ContactBusinessRelation: Record "Contact Business Relation"): Boolean`
- `UpdateSalesPersonCodeIfChanged(SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef; SourceOwnerIDFieldNo: Integer; SourceOwnerTypeFieldNo: Integer; AllowedOwnerTypeValue: Option; DestinationSalesPersonCodeFieldNo: Integer): Boolean`
- `UpdateFieldRefValueIfChanged(var DestinationFieldRef: FieldRef; NewFieldValue: Text): Boolean`
- `GetValidCRMUnitOfMeasureRecords(var CRMUom: Record "CRM Uom"; var CRMUomschedule: Record "CRM Uomschedule"; UnitOfMeasureCode: Code[10])`
- `GetNavCurrencyCode(TransactionCurrencyId: Guid): Code[10]`
- `GetCRMTransactioncurrency(CurrencyCode: Text): Guid`
- `ShowPage(RecordID: RecordID)`
- `FindNewValueForSpecialMapping(SourceFieldRef: FieldRef; var NewValue: Variant): Boolean`
- `FindPKByRecordID(RecID: RecordID; var PrimaryKey: Variant): Boolean`
- `FindRecordIDByPK(TableID: Integer; PrimaryKey: Variant; var RecID: RecordID): Boolean`
- `FindSourceIntegrationTableMapping(var IntegrationTableMapping: Record "Integration Table Mapping"; SourceFieldRef: FieldRef; DestinationFieldRef: FieldRef): Boolean`
- `IsClearValueOnFailedSync(SourceFieldRef: FieldRef; DestinationFieldRef: FieldRef): Boolean`
- `AreFieldsRelatedToMappedTables(SourceFieldRef: FieldRef; DestinationFieldRef: FieldRef; var IntegrationTableMapping: Record "Integration Table Mapping"): Boolean`
- `GetCoupledCDSUserId(SourceRecordRef: RecordRef): Guid`
- `ConvertBaseUnitOfMeasureToUomId(SourceFieldRef: FieldRef; DestinationFieldRef: FieldRef; var NewValue: Variant)`
- `ConvertUomIdToBaseUnitOfMeasure(SourceFieldRef: FieldRef; DestinationFieldRef: FieldRef; var NewValue: Variant)`
- `PrefixUnitGroupCode(SourceFieldRef: FieldRef; var NewValue: Variant)`
- `ConvertTableToOption(SourceFieldRef: FieldRef; DestinationFieldRef: FieldRef; var OptionValue: Integer): Boolean`
- `ConvertOptionToTable(SourceFieldRef: FieldRef; DestinationFieldRef: FieldRef; var TableValue: Text): Boolean`
- `UpdateCDSOptionMapping(OldRecId: RecordId; NewRecId: RecordId)`
- `FindNewValueForSpecialMapping(SourceFieldRef: FieldRef; DestinationFieldRef: FieldRef; var NewValue: Variant): Boolean` (internal)
- `IsContactBusinessRelationOptional(): Boolean` (internal)
- `IsContactTypeCheckIgnored(): Boolean` (internal)
- `TransformValue(SourceRecordRef: RecordRef; DestinationRecordRef: RecordRef; TransformationRule: Record "Transformation Rule"; SourceFieldNo: Integer; DestinationFieldNo: Integer)`
- `FulfillSalesOrder(SalesOrderId: Guid)` (internal)

Plus 42 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 5344 "CRM Product Name"](../codeunit/5344.md) (6 calls: `ConvertBaseUnitOfMeasureToUomId → SHORT`, `ConvertOptionToTable → CDSServiceName`, `ConvertTableToOption → CDSServiceName`, …)
- [Codeunit 5340 "CRM Integration Table Synch."](../codeunit/5340.md) (2 calls: `CoupleAndSyncItemUoM → SynchRecordsToIntegrationTable`, `CoupleAndSyncResourceUoM → SynchRecordsToIntegrationTable`)
- [Codeunit 10 "Type Helper"](../codeunit/10.md) (1 call: `SetDateField → Evaluate`)
- [Codeunit 5056 "CustCont-Update"](../codeunit/5056.md) (1 call: `UpdateContactOnModifyCustomer → OnModify`)
- [Codeunit 5057 "VendCont-Update"](../codeunit/5057.md) (1 call: `UpdateContactOnModifyVendor → OnModify`)
- [Codeunit 5302 "Outlook Synch. Type Conv"](../codeunit/5302.md) (1 call: `UpdateSalesPersonCodeIfChanged → TextToOptionValue`)
- [Codeunit 5330 "CRM Integration Management"](../codeunit/5330.md) (1 call: `ShowPage → GetCRMEntityUrlFromCRMID`)
- [Codeunit 5334 "CRM Setup Defaults"](../codeunit/5334.md) (1 call: `SetCRMDecimalsSupportedValue → GetProductQuantityPrecision`)
- [Codeunit 700 "Page Management"](../codeunit/700.md) (1 call: `ShowPage → PageRun`)
- [Codeunit 7201 "CDS Integration Impl."](../codeunit/7201.md) (1 call: `FulfillSalesOrder → InitializeConnection`)

## Called by

- [Codeunit 5341 "CRM Int. Table. Subscriber"](../codeunit/5341.md) (70 calls: `CheckCustPriceGroupForSync → FindNAVLocalCurrencyInCRM`, `CheckCustPriceGroupForSync → GetCRMTransactioncurrency`, `CheckPriceListHeaderForSync → FindNAVLocalCurrencyInCRM`, …)
- [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) (22 calls: `FindNewValueForCoupledRecordPK → FindNewValueForSpecialMapping`, `FindNewValueForCoupledRecordPK → FindPKByRecordID`, `FindNewValueForCoupledRecordPK → FindRecordIDByPK`, …)
- [Codeunit 6276 "Sust. Int. Table Subscriber"](../codeunit/6276.md) (7 calls: `TransferAssessmentFieldDataFromAssessmentRequirement → SynchRecordIfMappingExists`, `TransferBaseUnitFieldDataFromUnit → SynchRecordIfMappingExists`, `TransferConceptFieldDataFromRequirementConcept → SynchRecordIfMappingExists`, …)
- [Codeunit 5350 "CRM Statistics Job"](../codeunit/5350.md) (3 calls: `CreateOrUpdateCRMAccountStatistics → FindNAVLocalCurrencyInCRM`, `UpdateInvoice → CancelCRMInvoice`, `UpdateInvoice → UpdateCRMInvoiceStatusFromEntry`)
- [Codeunit 7237 "Master Data Mgt. Subscribers"](../codeunit/7237.md) (2 calls: `ApplyTransformations → TransformValue`, `UpdateContactParentCompany → SetContactParentCompany`)
- [Table 6610 "FS Bookable Resource"](../table/6610.md) (2 calls: `GetBaseCurrencyCode → GetNavCurrencyCode`, `GetCurrencyCode → GetNavCurrencyCode`)
- [Table 6611 "FS Bookable Resource Booking"](../table/6611.md) (2 calls: `GetBaseCurrencyCode → GetNavCurrencyCode`, `GetCurrencyCode → GetNavCurrencyCode`)
- [Table 6617 "FS Work Order"](../table/6617.md) (2 calls: `GetBaseCurrencyCode → GetNavCurrencyCode`, `GetCurrencyCode → GetNavCurrencyCode`)
- [Table 6619 "FS Work Order Product"](../table/6619.md) (2 calls: `GetBaseCurrencyCode → GetNavCurrencyCode`, `GetCurrencyCode → GetNavCurrencyCode`)
- [Table 6620 "FS Work Order Service"](../table/6620.md) (2 calls: `GetBaseCurrencyCode → GetNavCurrencyCode`, `GetCurrencyCode → GetNavCurrencyCode`)
- [Codeunit 5340 "CRM Integration Table Synch."](../codeunit/5340.md) (1 call: `IgnoreCompanyContactOnQueryPostFilterIgnoreRecord → IsContactTypeCheckIgnored`)
- [Codeunit 5343 "CRM Sales Order to Sales Order"](../codeunit/5343.md) (1 call: `CreateSalesOrderHeader → GetNavCurrencyCode`)
- [Codeunit 5348 "CRM Quote to Sales Quote"](../codeunit/5348.md) (1 call: `CreateOrUpdateSalesQuoteHeader → GetNavCurrencyCode`)
- [Codeunit 5397 "CDS Transformation Rule Mgt."](../codeunit/5397.md) (1 call: `ApplyTransformations → TransformValue`)
- [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) (1 call: `HandleOnBeforeInsertRecord → FindRecordIDByPK`)
- [Table 10 "Shipment Method"](../table/10.md) (1 call: `OnRename → UpdateCDSOptionMapping`)
- [Table 291 "Shipping Agent"](../table/291.md) (1 call: `OnRename → UpdateCDSOptionMapping`)
- [Table 3 "Payment Terms"](../table/3.md) (1 call: `OnRename → UpdateCDSOptionMapping`)
- [Table 5373 "CRM Full Synch. Review Line"](../table/5373.md) (1 call: `GenerateCRMSynchReviewLines → OnGetCDSOwnershipModel`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24, BC26-27

## Countries that replace it

[ES](../../localizations/es.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: "CRM Synch. Helper")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
