web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Table connection for table type CRM must be registered using RegisterTableConnection

(4) ShareShare
ReportReport
Posted on by 36
I am getting error when trying to use CRM Table from sales 365 to Business Central and modify or update in Sales 365 (CRM) using Custom Business Central API.
 
Exemple :
 
Error: "Table connection for table type CRM must be registered using RegisterTableConnection or cmdlet New-NAVTableConnection before it can be used"
 
procedure LookupCRMProduct(var CRMName: Text[250]): guid
var
    CRMProduct: Record "CRM Product";
begin
    CRMProduct.SetRange("Name", CRMName);
    if CRMProduct.FindFirst() then
        exit(CRMProduct.SystemId);
    exit('');
end;
I have the same question (0)
  • Verified answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at
    I also encountered this strange problem, but then I solved it after adding the following line of code.
     
    Hope this can give you some hints.
    Thanks.
    ZHU
  • Imran K Profile Picture
    29 on at
    As YuN ZHU has suggested for some reason this is usually resolved by checking the connection :
     
    CRMIntegrationManagement.IsCDSIntegrationEnabled()
  • Gerardo Rentería García Profile Picture
    25,169 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

    Troubleshooting Synchronization Errors - Business Central | Microsoft Learn

    Error Message When Trying to Access Integration Tables

    Best Regards
    Gerardo

  • Suggested answer
    Alexander Drogin Profile Picture
    262 on at
    If you want to access a CRM table directly from your code, rather than using the Business Central's Dataverse connector, you need to add some boilerplate code. In particular, any virtual CRM table that you want to use in BC, must be initialized by calling RegisterTableConnection.
     
    Look at the codeunit 5340 "CRM Integration Table Synch." to find an example of this initialization. OnRun trigger in this codeunit invokes the function InitConnection to set up the connection. This call ends in the table 5330 "CRM Connection Setup". You can follow the same logic and use one of the functions RegisterConnection or RegisterConnectionWithName from this table, or call Database.RegisterTableConnection directly.
     
     
  • Gaetan Hamel Profile Picture
    36 on at
    Thank you everyone. :)
     
    Yun Zhu answer dit the trick.
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,275 Super User 2025 Season 2 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans