microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
732 stars 243 forks source link

Error calling from job queue, soap or oData client, not from web client: "Table connection for table type CRM must be registered using RegisterTableConnection or cmdlet New-NAVTableConnection before it can be used" #5898

Closed ProdwareJuanan closed 4 years ago

ProdwareJuanan commented 4 years ago

Describe the bug When calling standard integration functionality from BC, we are able to update or create registers from CRM. Even doing a Get over "CRM Account" table in a report run manually works.

If we call same functionality via soap or oDatav4 using a published web service, an error occurs when opening a RecordRef. Also even doing a Get of a CRM type table same error occurs. Running same report with a Get over "CRM Account" from Job Queue shows same error.

Using the web client from BC, the behavior is right and the RecordRef works right. If we enqueue a report the error occurs but if we launch it there is no error.

To Reproduce It's not easy because it requires an integrated environment CRM-BC, though the easiest way is creating a report doing a Get over "CRM Account" table and launch it via Job Queue.

The error occurs when calling for instance function UpdateMultipleNow() in the codeunit "CRM Integration Management". Inside we have the call IntegrationTableMapping.GetRecordRef(CRMID, CRMRecordRef) The error occurs in the next line: IntegrationRecordRef.Open(IntegrationTableMapping."Integration Table ID");

if we check HasTableConnection it returns false, then we try to use RegisterTableConnection command inside the development and check again HasTableConnection, and it returns true, but same error.

Expected behavior Update or creation of the CRM register in BC such as happens when using web client.

Screenshots If applicable, add screenshots to help explain your problem.

5. Versions:

atoader commented 4 years ago

Hi! Please take a minute to read the guidelines for this repository https://github.com/microsoft/AL and our collection of frequently asked questions https://github.com/Microsoft/AL/wiki/frequently-Asked-Questions .

As this repository is only for issues related to the AL compiler in latest developer preview environment for Dynamics 365 Business Central. We suggest that you open a support case or file a bug in Collaborate, to ensure that all Business Central users benefit from your catch as soon as possible.

To open a support case, you can:

If you file the bug in Collaborate, remember to include steps to reproduce the issue, and the Business Central build number and country version you're using.