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"
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:
- AL Language: 5.0.271898
- Business Central: 16.1.12629.12805
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:
- Open a support request to CSS through the PartnerSource portal
- Contact your Service Account Manager (SAM) in your local subsidiary to understand what is included in your contract as of support incident and PAH (Partner Advisory Hours). Your SAM might also direct you "step by step" how to open a support request or how to get credentials, if this is the first time for you or your company
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.