Navision 2017(CU7), tableType = ExternalSQL, REGISTERTABLECONNECTION error

george175
Member Posts: 26
Hi All,
I have one question for inserting externalSQL table.
I have to add one view from another sql database into Nav 2017(CU7) for CRM Connector, becouse I have some issues with NULL values in custom CRM view in SQL database.
I created simple table with this setup:

On sql databse is it in database xxxx, and view has name dimSYSTEMY_CRM_w
Than I prepared page list on this table and insered code into onInit and openPage trigger to call codeunit function for table registration.
Code looks same like core in function IsCRMIntegrationEnabled in CU 5330:
function:
IF NOT HASTABLECONNECTION(TABLECONNECTIONTYPE::ExternalSQL,GETDEFAULTTABLECONNECTION(TABLECONNECTIONTYPE::ExternalSQL)) THEN BEGIN
IF lreCRMConnectionSetup.GET THEN;
IF NOT ISNULLGUID(lreCRMConnectionSetup."User Password Key") THEN
IF lreServicePassword.GET(lreCRMConnectionSetup."User Password Key") THEN BEGIN
UNREGISTERTABLECONNECTION(TABLECONNECTIONTYPE::ExternalSQL, 'xxxx');
REGISTERTABLECONNECTION(TABLECONNECTIONTYPE::ExternalSQL,'xxxx',STRSUBSTNO(ConnectionStringFormat,'yyyy','xxxx',lreCRMConnectionSetup."User Name",lreServicePassword.GetPassword));
SETDEFAULTTABLECONNECTION(TABLECONNECTIONTYPE::ExternalSQL,'dimsystemy_crm_w');
END;
END
IF I call this function separately, navision register table without any errros (I can debug it). But if run Page List of this table (my function is on onInit and onOpen page trigger), navision will show error, that I have to use commnad RegisterTableConnection or New-NavTableConnection in cmdlet, before i open this page.
I cant use debugger, becouse navision dont stop on break point a application will drop down with debugger.
I wanted to try use New-NavTableConnection, but I not have it in cmdlist.


Thank you for answers...,
George
I have one question for inserting externalSQL table.
I have to add one view from another sql database into Nav 2017(CU7) for CRM Connector, becouse I have some issues with NULL values in custom CRM view in SQL database.
I created simple table with this setup:

On sql databse is it in database xxxx, and view has name dimSYSTEMY_CRM_w
Than I prepared page list on this table and insered code into onInit and openPage trigger to call codeunit function for table registration.
Code looks same like core in function IsCRMIntegrationEnabled in CU 5330:
function:
IF NOT HASTABLECONNECTION(TABLECONNECTIONTYPE::ExternalSQL,GETDEFAULTTABLECONNECTION(TABLECONNECTIONTYPE::ExternalSQL)) THEN BEGIN
IF lreCRMConnectionSetup.GET THEN;
IF NOT ISNULLGUID(lreCRMConnectionSetup."User Password Key") THEN
IF lreServicePassword.GET(lreCRMConnectionSetup."User Password Key") THEN BEGIN
UNREGISTERTABLECONNECTION(TABLECONNECTIONTYPE::ExternalSQL, 'xxxx');
REGISTERTABLECONNECTION(TABLECONNECTIONTYPE::ExternalSQL,'xxxx',STRSUBSTNO(ConnectionStringFormat,'yyyy','xxxx',lreCRMConnectionSetup."User Name",lreServicePassword.GetPassword));
SETDEFAULTTABLECONNECTION(TABLECONNECTIONTYPE::ExternalSQL,'dimsystemy_crm_w');
END;
END
IF I call this function separately, navision register table without any errros (I can debug it). But if run Page List of this table (my function is on onInit and onOpen page trigger), navision will show error, that I have to use commnad RegisterTableConnection or New-NavTableConnection in cmdlet, before i open this page.
I cant use debugger, becouse navision dont stop on break point a application will drop down with debugger.
I wanted to try use New-NavTableConnection, but I not have it in cmdlist.


Thank you for answers...,
George
0
Answers
-
It looks like you opened the 'Dynamics NAV 2017 Development Shell'
The New-NAVTableConnection cmdlet is not in there, it is in the 'Dynamics NAV 2017 Administration Shell'
Or, in this window, using default installation paths, type:Import-Module "C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\Microsoft.Dynamics.Nav.Management.dll"
then you will have New-NAVTableConnection too.Jan Veenendaal0 -
Hi everyone,
@Jan_Veenendaal do you know what else should be done in order to use crm connectiontype in New-NAVTableConnection? For the time being it accepts only External tyoe
kind r egards0 -
HI,
i think you should use New-NAVCrmTable to get new entity from Microsoft Dynamics CRM.
https://msdn.microsoft.com/en-us/library/mt587045(v=nav.90).aspx0 -
Thanks @zych i have already done this step. The strange thing is that by using the cmdlet the txt object files of crm entities are created (after a long time running),trying to open them through nav asks for the similar code that it runs in crm connection setup table and crm integration management codeunit,thus registertable etc. Even with this code nav throws (not the same each time) 2 errors: 1.cannot login to crm 2.certificate in remote server is not valid(even we are trying to connect to Dynamics 365 online)
The same code,implementation is working in uat,development environments but not in production one.
So may i ask in order to NAV to connect to crm apart from outbound connectivity to ip range of crm,does it need anything else from networking?
Kind regards0 -
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions