As you may all know, it is possible to customize the integration with Dynamics 365 Business Central to Microsoft Dataverse or Dynamics 365 for Sales. More information here:
Customizing an Integration with Microsoft Dataverse - Business Central | Microsoft Docs
It is however not that well known how to synchronize specific fields that are supported in Dataverse but handled in a separate way in Dynamics 365 Business Central. E.g. the field of type Customer in Dataverse. In later releases of Dynamics 365 Business Central, this is documented:
AL Table Proxy Generator - Business Central | Microsoft Docs
See Related table section.
For earlier releases, we have the following documentation:
New-NAVCrmTable (Microsoft.Dynamics.Nav.Model.Tools) - Dynamics NAV | Microsoft Docs
CSS created a small script that shows how this works:
#Replace with your own values where needed
$CRMServer = ""
$ClientId = ""
$RedirectUri = "app://$ClientId"
$UserName = ""
New-NAVCrmTable -CRMServer $CRMServer -Entity account,contact,entitlement -ObjectId 50500,50501,50502 -Name "CRM Account", "CRM Contact", "CRM Entitlement"`
-AuthenticationType OAuth -ClientId $ClientID -RedirectUri $RedirectUri `
-OutputPath c:\nav -Credential (Get-Credential -UserName $UserName -Message "Enter Password") -Force
The output in table text file 50502 is like this:
{ 16 ; ;CustomerId ;GUID ;TableRelation=IF (CustomerIdType=CONST(account)) "CRM Account".AccountId
ELSE IF (CustomerIdType=CONST(contact)) "CRM Contact".ContactId;
ExternalName=customerid;
ExternalType=Customer;
CaptionML=ENU=Customer;
Description=Choose a contact or account for which this entitlement has been defined. }
It now includes the TableRelation.
Hope it helps.