---
id: object/codeunit/5345
type: object
title: Codeunit 5345 "Integration Rec. Synch. Invoke"
summary: Codeunit 5345 "Integration Rec. Synch. Invoke" in Base Application (Microsoft.Integration.SyncEngine). 13 public procedures, 21 events. Present since at least BC23, still in BC30, changed in BC24-25, BC27.
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: 08d1536f6804b7f5fc9c8846d456fb4e8767a0b46dc7b1af1271002944e462c6
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Integration/SynchEngine/IntegrationRecSynchInvoke.Codeunit.al
    title: src/Layers/W1/BaseApp/Integration/SynchEngine/IntegrationRecSynchInvoke.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: 5345
name: Integration Rec. Synch. Invoke
namespace: Microsoft.Integration.SyncEngine
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "27"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 50
  events: 21
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 41
  calls: 5
  called_by: 8
  implements: 0
---

# Codeunit 5345 "Integration Rec. Synch. Invoke"

> Codeunit 5345 "Integration Rec. Synch. Invoke" in Base Application (Microsoft.Integration.SyncEngine). 13 public procedures, 21 events. Present since at least BC23, still in BC30, changed in BC24-25, BC27.

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

## Events published

- `OnUpdateConflictDetected(var IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef; var UpdateConflictHandled: Boolean; var SkipRecord: Boolean)` (integration)
  - subscribers: [Codeunit 5330 "CRM Integration Management"](../codeunit/5330.md) HandleOnUpdateConflictDetected
- `OnDeletionConflictDetected(var IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var DeletionConflictHandled: Boolean)` (integration)
  - subscribers: [Codeunit 5330 "CRM Integration Management"](../codeunit/5330.md) HandleOnDeletionConflictDetected, [Codeunit 7233 "Master Data Management"](../codeunit/7233.md) OnDeletionConflictDetected
- `OnDeletionConflictSetSynchAction(var IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var SynchAction: Option "None",Insert,Modify,ForceModify,IgnoreUnchanged,Fail,Skip,Delete,Uncouple,Couple; var SetSynchActionHandled: Boolean)` (integration)
- `OnDeletionConflictDetectedSetRecordStateAndSynchAction(var IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var CoupledRecordRef: RecordRef; var RecordState: Option NotFound,Coupled,Decoupled; var SynchAction: Option "None",Insert,Modify,ForceModify,IgnoreUnchanged,Fail,Skip,Delete,Uncouple,Couple; var DeletionConflictHandled: Boolean)` (integration)
  - subscribers: [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) HandleOnDeletionConflictDetectedSetRecordStateAndSynchAction
- `OnBeforeTransferRecordFields(SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef)` (integration)
  - subscribers: [Codeunit 5341 "CRM Int. Table. Subscriber"](../codeunit/5341.md) OnBeforeTransferRecordFields, [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) OnBeforeTransferRecordFields, [Codeunit 7237 "Master Data Mgt. Subscribers"](../codeunit/7237.md) OnBeforeTransferRecordFields
- `OnAfterTransferRecordFields(var SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef; var AdditionalFieldsWereModified: Boolean; DestinationIsInserted: Boolean)` (integration)
  - subscribers: [Codeunit 5341 "CRM Int. Table. Subscriber"](../codeunit/5341.md) OnAfterTransferRecordFields, [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) OnAfterTransferRecordFields, [Codeunit 7237 "Master Data Mgt. Subscribers"](../codeunit/7237.md) OnAfterTransferRecordFields
- `OnBeforeModifyRecord(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef)` (integration)
  - subscribers: [Codeunit 5341 "CRM Int. Table. Subscriber"](../codeunit/5341.md) OnBeforeModifyRecord, [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) HandleOnBeforeModifyRecord, [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) HandleOnBeforeModifyRecord, [Codeunit 7237 "Master Data Mgt. Subscribers"](../codeunit/7237.md) OnBeforeModifyRecord
- `OnAfterModifyRecord(IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef)` (integration)
  - subscribers: [Codeunit 5341 "CRM Int. Table. Subscriber"](../codeunit/5341.md) OnAfterModifyRecord, [Codeunit 6276 "Sust. Int. Table Subscriber"](../codeunit/6276.md) HandleOnAfterModifyRecord, [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) HandleOnAfterModifyRecord, [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) HandleOnAfterModifyRecord, [Codeunit 7237 "Master Data Mgt. Subscribers"](../codeunit/7237.md) OnAfterModifyRecord
- `OnErrorWhenModifyingRecord(IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef)` (integration)
- `OnBeforeInsertRecord(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef; var InsertWithSystemId: Boolean)` (integration)
  - subscribers: [Codeunit 5341 "CRM Int. Table. Subscriber"](../codeunit/5341.md) OnBeforeInsertRecord, [Codeunit 6276 "Sust. Int. Table Subscriber"](../codeunit/6276.md) HandleOnBeforeInsertRecord, [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) HandleOnBeforeInsertRecord, [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) HandleOnBeforeInsertRecord, [Codeunit 7237 "Master Data Mgt. Subscribers"](../codeunit/7237.md) HandleOnBeforeInsertRecord
- `OnAfterInsertRecord(IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef)` (integration)
  - subscribers: [Codeunit 5341 "CRM Int. Table. Subscriber"](../codeunit/5341.md) OnAfterInsertRecord, [Codeunit 6276 "Sust. Int. Table Subscriber"](../codeunit/6276.md) HandleOnAfterInsertRecord, [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) HandleOnAfterInsertRecord, [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) HandleOnAfterInsertRecord, [Codeunit 7237 "Master Data Mgt. Subscribers"](../codeunit/7237.md) HandleOnAfterInsertRecord
- `OnAfterUnchangedRecordHandled(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef; DestinationRecordRef: RecordRef)` (integration)
  - subscribers: [Codeunit 5341 "CRM Int. Table. Subscriber"](../codeunit/5341.md) OnAfterUnchangedRecordHandled, [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) HandleOnAfterUnchangedRecordHandled, [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) OnAfterUnchangedRecordHandled, [Codeunit 7237 "Master Data Mgt. Subscribers"](../codeunit/7237.md) HandleOnAfterUnchangedRecordHandled
- `OnBeforeApplyRecordTemplate(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef; var TemplateCode: Code[10])` (integration)
- `OnBeforeDetermineConfigTemplateCode(IntegrationTableMapping: Record "Integration Table Mapping"; var TemplateCode: Code[10]; var Handled: Boolean)` (integration)
  - subscribers: [Codeunit 7237 "Master Data Mgt. Subscribers"](../codeunit/7237.md) OnBeforeDetermineConfigTemplateCode
- `OnAfterApplyRecordTemplate(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef)` (integration)
- `OnFindUncoupledDestinationRecord(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef; var DestinationIsDeleted: Boolean; var DestinationFound: Boolean)` (integration)
  - subscribers: [Codeunit 5341 "CRM Int. Table. Subscriber"](../codeunit/5341.md) OnFindUncoupledDestinationRecord
- `OnUpdateIntegrationRecordCoupling(IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef; var IsHandled: Boolean; IntegrationTableConnectionType: TableConnectionType)` (integration)
  - subscribers: [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) HandleOnUpdateIntegrationRecordCoupling, [Codeunit 7233 "Master Data Management"](../codeunit/7233.md) HandleOnUpdateIntegrationRecordCoupling
- `OnWasModifiedAfterLastSynch(IntegrationTableConnectionType: TableConnectionType; IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var SourceWasChanged: Boolean; var IsHandled: Boolean)` (integration)
  - subscribers: [Codeunit 7237 "Master Data Mgt. Subscribers"](../codeunit/7237.md) OnWasModifiedAfterLastSynch
- `OnUpdateIntegrationRecordTimestamp(IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef; IntegrationTableConnectionType: TableConnectionType; JobID: Guid; BothModified: Boolean; var IsHandled: Boolean)` (integration)
  - subscribers: [Codeunit 7233 "Master Data Management"](../codeunit/7233.md) HandleOnUpdateIntegrationRecordTimestamp
- `OnBeforeIgnoreUnchangedRecordHandled(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef; DestinationRecordRef: RecordRef)` (integration)
  - subscribers: [Codeunit 5341 "CRM Int. Table. Subscriber"](../codeunit/5341.md) OnBeforeIgnoreUnchangedRecordHandled, [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) HandleOnBeforeIgnoreUnchangedRecordHandled
- `OnInsertRecordOnAfterApplyConfigTemplate(IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordREf; var DestinationRecordRef: RecordRef)` (integration)

## Procedures

- `SetContext(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef; DestinationRecordRef: RecordRef; IntegrationRecordSynch: Codeunit "Integration Record Synch."; SynchAction: Option; IgnoreSynchOnlyCoupledRecords: Boolean; JobId: Guid; IntegrationTableConnectionType: TableConnectionType)`
- `GetContext(var IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef; var IntegrationRecordSynch: Codeunit "Integration Record Synch."; var SynchAction: Option)`
- `WasModifiedAfterLastSynch(IntegrationTableMapping: Record "Integration Table Mapping"; RecordRef: RecordRef): Boolean`
- `GetRowLastModifiedOn(IntegrationTableMapping: Record "Integration Table Mapping"; FromRecordRef: RecordRef): DateTime`
- `FindRecord(var IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef; var IsDestinationDeleted: Boolean; IntegrationTableConnectionType: TableConnectionType): Integer` (internal)
- `FindCoupledRecord(var IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef; var IsDestinationDeleted: Boolean; IntegrationTableConnectionType: TableConnectionType): Integer` (internal)
- `PrepareNewDestination(var IntegrationTableMapping: Record "Integration Table Mapping"; var RecordRef: RecordRef; var CoupledRecordRef: RecordRef)`
- `CheckTransferFields(var IntegrationRecordSynch: Codeunit "Integration Record Synch."; IntegrationTableMapping: Record "Integration Table Mapping"; var SourceRecordRef: RecordRef; var DestinationRecordRef: RecordRef; var FieldsModified: Boolean; var BidirectionalFieldsModified: Boolean)`
- `MarkIntegrationRecordAsFailed(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef; JobId: Guid; IntegrationTableConnectionType: TableConnectionType)`
- `MarkIntegrationRecordAsFailed(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef; JobId: Guid; IntegrationTableConnectionType: TableConnectionType; ForceMarkAsSkipped: Boolean)`
- `MarkIntegrationRecordAsFailed(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef; JobId: Guid; IntegrationTableConnectionType: TableConnectionType; var SyncAction: Option)`
- `FindTableConfigTemplate(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef): Code[10]` (internal)
- `FindIntTableConfigTemplate(IntegrationTableMapping: Record "Integration Table Mapping"; SourceRecordRef: RecordRef): Code[10]` (internal)

Plus 16 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 5336 "Integration Record Synch."](../codeunit/5336.md) (10 calls: `CheckTransferFields → (object)`, `CheckTransferFields → GetWasBidirectionalFieldModified`, `CheckTransferFields → GetWasModified`, …)
- [Codeunit 5338 "Integration Record Management"](../codeunit/5338.md) (6 calls: `FindCoupledRecord → FindRecordIdByIntegrationTableUid`, `FindIntegrationTableRecord → FindIntegrationTableUIdByRecordRef`, `FindRecord → FindRecordIdByIntegrationTableUid`, …)
- [Codeunit 5397 "CDS Transformation Rule Mgt."](../codeunit/5397.md) (2 calls: `CheckTransferFields → ApplyTransformations`, `TransferFields → ApplyTransformations`)
- [Codeunit 5330 "CRM Integration Management"](../codeunit/5330.md) (1 call: `InsertRecord → IsCRMTable`)
- [Codeunit 8612 "Config. Template Management"](../codeunit/8612.md) (1 call: `ApplyConfigTemplate → UpdateRecord`)

## Called by

- [Codeunit 5335 "Integration Table Synch."](../codeunit/5335.md) (6 calls: `CheckTransferFields → CheckTransferFields`, `CheckTransferFields → SetContext`, `Synchronize → (object)`, …)
- [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) (4 calls: `FixPrimaryContactIdInCDS → WasModifiedAfterLastSynch`, `FixPrimaryContactNo → WasModifiedAfterLastSynch`, `HandleOnBeforeInsertRecord → FindTableConfigTemplate`, …)
- [Codeunit 5330 "CRM Integration Management"](../codeunit/5330.md) (2 calls: `GetSelectedSingleSyncDirection → WasModifiedAfterLastSynch`, `WasRecordModifiedAfterLastSynch → WasModifiedAfterLastSynch`)
- [Codeunit 7233 "Master Data Management"](../codeunit/7233.md) (2 calls: `GetSelectedSingleSyncDirection → WasModifiedAfterLastSynch`, `WasRecordModifiedAfterLastSynch → WasModifiedAfterLastSynch`)
- [Codeunit 7237 "Master Data Mgt. Subscribers"](../codeunit/7237.md) (2 calls: `FixPrimaryContactNo → WasModifiedAfterLastSynch`, `UpdateContactParentCompany → WasModifiedAfterLastSynch`)
- [Codeunit 5357 "Int. Rec. Uncouple Invoke"](../codeunit/5357.md) (1 call: `UncoupleRecord → FindCoupledRecord`)
- [Codeunit 5361 "Int. Rec. Couple Invoke"](../codeunit/5361.md) (1 call: `CoupleRecord → FindCoupledRecord`)
- [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) (1 call: `HandleOnDeletionConflictDetectedSetRecordStateAndSynchAction → PrepareNewDestination`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-25, BC27

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: "Integration Rec. Synch. Invoke")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
