---
id: object/codeunit/7200
type: object
title: Codeunit 7200 "CDS Integration Mgt."
summary: Codeunit 7200 "CDS Integration Mgt." in Base Application (Microsoft.Integration.Dataverse). 32 public procedures, 12 events. Present since at least BC23, still in BC30, changed in BC24, 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: 3c77c8fa472a7f48958f8e082393952d1b84ed9836b8fdd20e2e3ec0db608e15
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Integration/Dataverse/CDSIntegrationMgt.Codeunit.al
    title: src/Layers/W1/BaseApp/Integration/Dataverse/CDSIntegrationMgt.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: 7200
name: CDS Integration Mgt.
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"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 44
  events: 12
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 5
  calls: 1
  called_by: 25
  implements: 0
---

# Codeunit 7200 "CDS Integration Mgt."

> Codeunit 7200 "CDS Integration Mgt." in Base Application (Microsoft.Integration.Dataverse). 32 public procedures, 12 events. Present since at least BC23, still in BC30, changed in BC24, BC28.

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

## Properties

| Property | Value |
|---|---|
| Access | Public |
| SingleInstance | true |

## Events published

- `OnBeforeRegisterConnection()` (integration): Integration event raised before registering the Dataverse connection.
- `OnAfterRegisterConnection()` (integration): Integration event raised after registering the Dataverse connection.
- `OnBeforeUnregisterConnection()` (integration): Integration event raised before unregistering the Dataverse connection.
- `OnAfterUnregisterConnection()` (integration): Integration event raised after unregistering the Dataverse connection.
- `OnBeforeActivateConnection()` (integration): Integration event raised before activating the Dataverse connection.
- `OnAfterActivateConnection()` (integration): Integration event raised after activating the Dataverse connection.
- `OnEnableIntegration()` (integration): Integration event raised when the Dataverse integration is enabled.
  - subscribers: [Codeunit 7204 "CDS Setup Defaults"](../codeunit/7204.md) HandleOnEnableIntegration
- `OnDisableIntegration()` (integration): Integration event raised when the Dataverse integration is disabled.
- `OnGetIntegrationRequiredRoles(var RequiredRoleIdList: List of [Guid])` (integration): Integration event to retrieve the list of required Dataverse security roles for integration.
  - subscribers: [Codeunit 5330 "CRM Integration Management"](../codeunit/5330.md) HandleOnGetIntegrationRequiredRoles
- `OnGetIntegrationSolutions(var SolutionUniqueNameList: List of [Text])` (integration): Integration event to retrieve the list of required Dataverse solutions for integration.
  - subscribers: [Codeunit 5330 "CRM Integration Management"](../codeunit/5330.md) HandleOnGetIntegrationSolutions
- `OnGetDetailedLoggingEnabled(var Enabled: Boolean)` (integration): Integration event to determine if detailed logging is enabled for Dataverse integration.
- `OnHasCompanyIdField(TableId: Integer; var HasField: Boolean)` (integration): Integration event to check if a table has a company ID field.
  - subscribers: [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) HandleOnHasCompanyIdField, [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) HandleOnHasCompanyIdField

## Procedures

- `TestConnection(): Boolean`: Tests if the active connection to Dataverse is working.
- `ActivateConnection(): Boolean`: Activates the connection to Dataverse.
- `RegisterConnection(): Boolean`: Registers the connection to Dataverse.
- `IsIntegrationEnabled(): Boolean`: Checks if the Dataverse integration is enabled.
- `IsBusinessEventsEnabled(): Boolean`: Checks if business events are enabled for the Dataverse integration.
- `IsConnectionActive(): Boolean`: Checks if the connection to Dataverse is currently active.
- `IsSolutionInstalled(): Boolean`: Checks if the default Dataverse integration solution is installed.
- `IsSolutionInstalled(UniqueName: Text): Boolean`: Checks if a specific Dataverse solution is installed.
- `GetSolutionVersion(var Version: Text): Boolean`: Gets the version of the default Dataverse integration solution.
- `GetSolutionVersion(UniqueName: Text; var Version: Text): Boolean`: Gets the version of a specific Dataverse solution.
- `CheckCompanyId(var RecRef: RecordRef): Boolean`: Checks if the company ID on the record matches the current company.
- `CheckOwningTeam(var RecRef: RecordRef): Boolean`: Checks if the record is owned by the configured owning team.
- `CheckOwningUser(var RecRef: RecordRef; UserId: Guid): Boolean`: Checks if the record is owned by the specified user.
- `CheckOwningUser(var RecRef: RecordRef; UserId: Guid; SkipBusinessUnitCheck: Boolean): Boolean`: Checks if the record is owned by the specified user with an option to skip business unit check.
- `HasCompanyIdField(TableId: Integer): Boolean`: Checks if the specified table has a company ID field.
- `ResetCompanyId(var RecRef: RecordRef): Boolean`: Resets the company ID field on the record to empty.
- `SetCompanyId(var RecRef: RecordRef): Boolean`: Sets the company ID field on the record to the current company.
- `SetOwningTeam(var RecRef: RecordRef): Boolean`: Sets the owning team on the record to the configured default team.
- `SetOwningUser(var RecRef: RecordRef; UserId: Guid): Boolean`: Sets the owning user on the record to the specified user.
- `SetOwningUser(var RecRef: RecordRef; UserId: Guid; SkipBusinessUnitCheck: Boolean): Boolean`: Sets the owning user on the record to the specified user with an option to skip business unit check.
- `GetCDSCompany(var CDSCompany: Record "CDS Company"): Boolean`: Gets the Dataverse company record that corresponds to the current Business Central company.
- `GetCoupledBusinessUnitId(): Guid`: Gets the ID of the business unit that is coupled with the current company.
- `IsTeamOwnershipModelSelected(): Boolean`: Checks if the team ownership model is selected for the integration.
- `RegisterAssistedSetup()`: Registers the Dataverse integration assisted setup.
- `ResetCache()`: Resets the cached integration data.
- `GetOptionSetMetadata(EntityName: Text; FieldName: Text): Dictionary of [Integer, Text]`: Gets the metadata for an option set field in Dataverse.
- `InsertOptionSetMetadata(EntityName: Text; FieldName: Text; NewOptionLabel: Text): Integer`: Inserts a new option into an option set field in Dataverse.
- `InsertOptionSetMetadataWithOptionValue(EntityName: Text; FieldName: Text; NewOptionLabel: Text; NewOptionValue: Integer): Integer`: Inserts a new option into an option set field in Dataverse with a specific option value.
- `UpdateOptionSetMetadata(EntityName: Text; FieldName: Text; OptionValue: Integer; NewOptionLabel: Text)`: Updates the label of an existing option in an option set field in Dataverse.
- `FindCompanyIdField(var RecRef: RecordRef; var CompanyIdFldRef: FieldRef): Boolean`: Finds the company ID field in a record reference.
- `GetEntityMetadata(TableNo: Integer): Text`: Gets the entity metadata for a Dataverse table.
- `GetEntityFields(TableNo: Integer; var IntegrationField: Record "Integration Field")`: Gets the field metadata for a Dataverse entity and populates a temporary Field record.

## 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 7201 "CDS Integration Impl."](../codeunit/7201.md) (28 calls: `ActivateConnection → ActivateConnection`, `CheckCompanyId → CheckCompanyId`, `CheckOwningTeam → CheckOwningTeam`, …)

## Called by

- [Codeunit 6611 "FS Setup Defaults"](../codeunit/6611.md) (14 calls: `InsertIntegrationTableMapping → HasCompanyIdField`, `ResetConfiguration → ActivateConnection`, `ResetConfiguration → RegisterConnection`, …)
- [Codeunit 7205 "CDS Int. Table. Subscriber"](../codeunit/7205.md) (12 calls: `HandleOnBeforeUncoupleRecord → OnHasCompanyIdField`, `HandleOnBeforeUncoupleRecord → ResetCompanyId`, `HandleOnIsCDSIntegrationEnabled → IsIntegrationEnabled`, …)
- [Codeunit 5334 "CRM Setup Defaults"](../codeunit/5334.md) (10 calls: `InsertIntegrationTableMapping → HasCompanyIdField`, `ResetBidirectionalSalesOrderMapping → GetCDSCompany`, `ResetConfiguration → IsTeamOwnershipModelSelected`, …)
- [Codeunit 7204 "CDS Setup Defaults"](../codeunit/7204.md) (7 calls: `InsertIntegrationTableMapping → HasCompanyIdField`, `ResetConfiguration → ActivateConnection`, `ResetConfiguration → IsTeamOwnershipModelSelected`, …)
- [Codeunit 7201 "CDS Integration Impl."](../codeunit/7201.md) (6 calls: `GetIntegrationRequiredRoles → OnGetIntegrationRequiredRoles`, `GetIntegrationSolutions → OnGetIntegrationSolutions`, `HasCompanyIdField → OnHasCompanyIdField`, …)
- [Codeunit 6610 "FS Int. Table Subscriber"](../codeunit/6610.md) (5 calls: `HandleOnBeforeUncoupleRecord → OnHasCompanyIdField`, `HandleOnBeforeUncoupleRecord → ResetCompanyId`, `OnEnableMultiCompanySynchronization → FindCompanyIdField`, …)
- [Table 7200 "CDS Connection Setup"](../table/7200.md) (4 calls: `DisableConnection → OnDisableIntegration`, `EnableConnection → OnEnableIntegration`, `SetBaseCurrencyData → ActivateConnection`, …)
- [Codeunit 6277 "Sust. Setup Defaults"](../codeunit/6277.md) (3 calls: `InsertIntegrationTableMapping → HasCompanyIdField`, `ResetConfiguration → ActivateConnection`, `ResetConfiguration → RegisterConnection`)
- [Table 5335 "Integration Table Mapping"](../table/5335.md) (3 calls: `CreateRecord → HasCompanyIdField`, `DisableMultiCompanySynchronization → GetCDSCompany`, `EnableMultiCompanySynchronization → GetCDSCompany`)
- [Codeunit 5330 "CRM Integration Management"](../codeunit/5330.md) (2 calls: `CheckSolutionVersionOutdated → GetSolutionVersion`, `ResetIntTableMappingDefaultConfiguration → IsTeamOwnershipModelSelected`)
- [Codeunit 5364 "Int. Option Synch. Invoke"](../codeunit/5364.md) (2 calls: `InsertCRMOption → InsertOptionSetMetadata`, `ModifyCRMOption → UpdateOptionSetMetadata`)
- [Codeunit 5348 "CRM Quote to Sales Quote"](../codeunit/5348.md) (1 call: `OnRun → GetCDSCompany`)
- [Codeunit 5391 "Man. Int. Field Mapping"](../codeunit/5391.md) (1 call: `TryCreateRuntimeFields → GetEntityMetadata`)
- [Codeunit 6153 "API Webhook Notification Mgt."](../codeunit/6153.md) (1 call: `GetSubscriptions → IsBusinessEventsEnabled`)
- [Page 1279 "Service Connections"](../page/1279.md) (1 call: `OnInit → RegisterAssistedSetup`)
- [Page 1310 "O365 Activities"](../page/1310.md) (1 call: `OnOpenPage → IsIntegrationEnabled`)
- [Page 5351 "CRM Sales Quote List"](../page/5351.md) (1 call: `OnOpenPage → GetCDSCompany`)
- [Page 9062 "User Security Activities"](../page/9062.md) (1 call: `OnOpenPage → IsIntegrationEnabled`)
- [Page 9072 "IT Operations Activities"](../page/9072.md) (1 call: `OnOpenPage → IsIntegrationEnabled`)
- [Page 9076 "Sales & Relationship Mgr. Act."](../page/9076.md) (1 call: `OnOpenPage → IsIntegrationEnabled`)
- [Table 5332 "Coupling Record Buffer"](../table/5332.md) (1 call: `FindCRMOptionByName → GetOptionSetMetadata`)
- [Table 5384 "Man. Int. Field Mapping"](../table/5384.md) (1 call: `GetAllValidIntegrationFields → GetEntityFields`)
- [Table 7203 "CRM Payment Terms"](../table/7203.md) (1 call: `Load → GetOptionSetMetadata`)
- [Table 7204 "CRM Freight Terms"](../table/7204.md) (1 call: `Load → GetOptionSetMetadata`)
- [Table 7205 "CRM Shipping Method"](../table/7205.md) (1 call: `Load → GetOptionSetMetadata`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24, 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: "CDS Integration Mgt.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
