web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    19,137 Super User 2025 Season 2 on at
    Table connection for table type CRM must be registered using RegisterTableConnection
  • Gaetan Hamel Profile Picture
    36 on at
    Table connection for table type CRM must be registered using RegisterTableConnection
    Thank you everyone. :)
     
    Yun Zhu answer dit the trick.
     
  • Suggested answer
    Alexander Drogin Profile Picture
    262 on at
    Table connection for table type CRM must be registered using RegisterTableConnection
    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.
     
     
  • Gerardo Rentería García Profile Picture
    23,572 Most Valuable Professional on at
    Table connection for table type CRM must be registered using RegisterTableConnection

    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

  • Imran K Profile Picture
    29 on at
    Table connection for table type CRM must be registered using RegisterTableConnection
    As YuN ZHU has suggested for some reason this is usually resolved by checking the connection :
     
    CRMIntegrationManagement.IsCDSIntegrationEnabled()
  • Verified answer
    YUN ZHU Profile Picture
    92,367 Super User 2025 Season 2 on at
    Table connection for table type CRM must be registered using RegisterTableConnection
    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

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 4,304

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,045

#3
Sumit Singh Profile Picture

Sumit Singh 2,970

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans