RSS

Business Central Error Message: Unable to read data from the transport connection

Trying to set up access to snapshot debugger for Microsoft Business Central OnPrem with remotely access when I got this error message:

[2023-02-02 10:50:17.20] Requesting metadata for a snapshot debugging session. 
[2023-02-02 10:50:17.20] Sending request to https://<CompanyURL>.com:7483/<BC INSTANCE>/snapshotdebugger/snapshotendpointmetadata
[2023-02-02 10:50:17.28] Error: The SSL connection could not be established, see inner exception.
Unable to read data from the transport connection: En befintlig anslutning tvingades att stänga av fjärrvärddatorn..
En befintlig anslutning tvingades att stänga av fjärrvärddatorn.

[2023-02-02 10:50:17.28] Error: An error occured while processing the request.
Request ID: c563c627-4bc2-44ce-9cf0-6f1b5cd22d82
Session ID: 00721ee7-41e7-4f25-b1fc-354139dba1a6

If you are targeting a cloud instance, supply these IDs if contacting Microsoft support.
[2023-02-02 10:51:03.79] All reference symbols have been downloaded.

Apparently I had forgotten to activate both DeveloperServicesSSLEnabled and SnapshotDebuggerServicesSSLEnabled settings on the NST at the same time. Once I turned both of them off, restarted the NST and then activated both again then I stopped receiving this error.

 
Leave a comment

Posted by on 2023-02-02 in Okategoriserade

 

Tags: , , ,

Business Central: Cannot determine the frame size or a corrupted frame was received.

We were setting up a new customer with Microsoft Business Central OnPrem and I tried to download the symbols from the customer remotely.
I knew the NST and firewall was configured but I still got the following error message when I ran AL:Download Symbols:

[2023-02-02 10:37:32.45] Using reference symbols cache path: c:\GIT\algo\BC21.alpackages
[2023-02-02 10:37:32.46] Sending request to https://<CompanyURL>.com:7389/<BC INSTANCE NAME>/dev/metadata?tenant=default
[2023-02-02 10:37:32.54] Error: The SSL connection could not be established, see inner exception.
Cannot determine the frame size or a corrupted frame was received.

[2023-02-02 10:37:32.54] Error: An error occured while processing the request.
Request ID: a8739f78-4316-4c39-ad9b-1353bddbee16
Session ID: 00721ee7-41e7-4f25-b1fc-354139dba1a6

If you are targeting a cloud instance, supply these IDs if contacting Microsoft support.
[2023-02-02 10:37:32.54] Sending request to https://<CompanyURL>.com:7389/<BC INSTANCE NAME>/dev/metadata?tenant=default
[2023-02-02 10:37:32.64] Error: The SSL connection could not be established, see inner exception.
Cannot determine the frame size or a corrupted frame was received.

[2023-02-02 10:37:32.64] Error: An error occured while processing the request.
Request ID: 6294518c-9186-4d82-bc5b-3dcf89a8c8be
Session ID: 00721ee7-41e7-4f25-b1fc-354139dba1a6

If you are targeting a cloud instance, supply these IDs if contacting Microsoft support

It turns out our technician had forgotten to enable the setting DeveloperServicesSSLEnabled to true.
Once activated it worked with downloading the symbols

.

.

 
Leave a comment

Posted by on 2023-02-02 in Okategoriserade

 

Tags: ,

Business Central: Can’t find/get invoices with API

We had a scenario were we did an OnPrem installation for a customer (BC 19.x). We had set up three NST, one for web clients, one for job queue and one for API. We had a Cronus database as a base were we created a new empty company besides the cronus company.
When we wanted to get posted invoices via API we couldn’t find any even though we had posted several invoices(!). First we thought something was wrong with the API NST but we could reach other companies and it became even weirder when we tried to access invoices in the cronus company, then it worked!

So why the hell did it work against the Cronus company in the same database with the same NST BUT NOT for our newly created company!? 🤔

First you should know that when you try to get invoices via API it doesn’t access them from standard Sales Invoice Header/Lines table. Instead these invoices are copied to a mirror table where it stores both posted AND unposted invoices. So every time you post an invoice it will be stored in the mirror table that is used for API communication.

Ok, so we compared the mirror table (“Sales Invoice Entity Aggregate”) in our new company with the one in the Cronus company. There were data in the Cronus company but no data in the new one. Why is that?

Eventually we found the learn page for it.

Great there is button we can run to fill the tables the API-setup to fill the mirror tables ! 😁 We ran, it and then we could FINALLY reach the invoices, BUT why does not new posted invoices get copied there automatically? 🤔

It took some debugging until we found out why. In Codeunit “Sales Invoice Aggregator” is a subscriber event that subscribes on when Posted Invoices are being inserted and then copies them to the mirror table BUT, if AND only if the API is enabled.

But we have enabled it on our API NST… Lets look closer at the IsApiEnabled function:

It is getting the “Enable API Services” setting from the NST.

Remember I said that we generally have three NST, one for web clients, one for job queues and one for API. This means that if we post invoices on the web client NST and don’t have “Enable API Services” on that NST it won’t copy those records to the mirror tables that the API accesses.

Conclusion:
Even though we have a dedicated NST for API we still have to enable “Enable API Services” for all the NST:s that generate data that should be copied API mirror tables. But it is enought to only expose one NST via the firewall 😉

 
Leave a comment

Posted by on 2022-11-19 in Okategoriserade

 

Tags: , ,

How-To Compile a Business Central App/Extenssion Manually

How-To Compile a Business Central App/Extenssion Manually

Do you want to know how to compile your Business Central app manually as VS Code does? Then you will get started with this blog post.

It all starts with the ALLanguage.vsix file.
On the installation DVD it can be found at the path:
ModernDev\program files\Microsoft Dynamics NAV\130\AL Development Environment

If you use docker it can be found at C:\Run\*.vsix

The VSIX file contains the AL language and the compiler.
This file is basically a ZIP folder. Rename it to .zip and extract it to C:\Build\vsix

You can compile your app by using the command prompt or by using powershell.
Lets say that the app is located at: C:\GIT\MyProject\App”
Then we can run the following code in the command prompt to compile our app:
cd C:\build\vsix\extension\bin
alc.exe /project:"C:\GIT\MyProject\App" /packagecachepath:"C:\GIT\MyProject\App\.alpackages" /out:"C:\GIT\MyProject\App\MyApp.app"


If you would like to use powershell it would look like this:

$alcPath = 'C:\build\vsix\extension\bin'
$appProjectFolder = 'C:\GIT\MyProject\App'
$appSymbolsFolder = 'C:\GIT\MyProject\App\.alpackages'
$appOutputFile = 'C:\GIT\MyProject\App\MyApp.app'
Set-Location -Path $alcPath
& .\alc.exe /project:$appProjectFolder /packagecachepath:$appSymbolsFolder /out:$appOutputFile

If you want to do this with powershell and docker there is already an existing cmdlet that does this which I got the inspiration from.
The cmdlet is Compile-AppInNavContainer.ps1 and is a part of the navcontainerhelper.






 
Leave a comment

Posted by on 2019-03-03 in Okategoriserade

 

Tags: , ,

A package with publisher ‘Microsoft’, name ‘Application’, and a version compatible with ‘13.0.0.0’ could not be loaded.

A package with publisher ‘Microsoft’, name ‘Application’, and a version compatible with ‘13.0.0.0’ could not be loaded.

I recieved the following error when trying to build my Business Central App:
A package with publisher ‘Microsoft’, name ‘Application’, and a version compatible with ‘13.0.0.0’ could not be loaded.
Compile-AppInNavContainer : App generation failed At C:\Install\BuildAgent\vsts-agent-win-x64-2.146.0\_work\3\s\PowerShell\BuildAgent\Compile-App.ps1:24 char:5 + Compile-AppInNavContainer -containerName $containerName ` + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Compile-AppInNavContainer
PowerShell exited with code ‘1’.

The scenario I had was an onprem extension version 13 that should be run on a cu 3 which relies on imported CSIDE objects. 

What I did to solve the problem was to follow my checklist for CSIDE objects not includes in symbols.

 
Leave a comment

Posted by on 2019-03-03 in Okategoriserade

 

Tags: , , ,

Business Central, CSIDE objects not included in symbols

Do you want to go hybrid where you mix your Business Central extensions with CSIDE objects and have problems with getting these objects included in symbols? Then you will find a checklist here that hopefully helps you to solve that issue.

If you want to get a better understanding of symbols before you proceed I recomend this blog post Symbols demystifed.

If you have upgraded to Business Central from an earlier version, double check that you have imported the business central symbols. Instructions on how to do that can be found here.

If you are going to go hybrid and mix CSIDE object changes with extensions you have to first enable generating of symbols in the NST. You can find the setting in the Business Central Administration.

Alternatively you change directly in the CustomSettings.config file (C:\Program Files\Microsoft Dynamics 365 Business Central\130\Service)

If you are running docker and use the command New-NavContainer from navcontainerhelper powershell library you can add the flag “enableSymbolLoading”.

enableSymbolLoading in docker

When these settings are done, check that you actually have imported your CSIDE objects 😉

After you have downloaded the symbols, check that your cside objects are included in the symbols. I do this with the VS Code extension AL Explorer. Right click on the symbol file Microsoft_Application_<Version No.>.app, choose “Open In AL Object Browser”. Scroll down and see if the objects are included.

If they aren’t included doublecheck that the version number in the client matches the version number on the symbol file. There is a bug in a lot of onprem versions where the application symbols are wrong, which have been reported at GitHub

If these versions doesn’t match then unpublish the wrong symbol app or regenerate symbos. Instructions exists this link. Follow them and then download the symbols again. 
A minor detail, make sure that your application version in app.json is at least on the same version number as you installation. Ex. if your application version is 13.0.27183, make sure your application version is at least 13.0.0.0.

So now you have the right symbol file and it still doesn’t work. The last thing to do is to do a COMPLETE generation of symbols in the datase. It seems that if you import a smaller set of CSIDE objects you manage without this but if you have bigger sets of CSIDE objects you need to do this.
If you run a complete installation see this link for instructions to do a complete generation of symbols.

If you run docker and use the navcontainerhelper powershell library you can use the cmdlet Generate-SymbolsInNavContainer.

I hope these checks helped you with solving the symbol problem.

 
6 Comments

Posted by on 2019-03-03 in Okategoriserade

 

Tags: , , , , ,

Error accessing Website Microsoft Dynamics NAV 2017 Web Client – Domain Control Validated chain building failed. The certificate that was used has a trust chain that cannot be verified

Error accessing Website Microsoft Dynamics NAV 2017 Web Client – Domain Control Validated chain building failed. The certificate that was used has a trust chain that cannot be verified

Apparently you have to turn off the property “Load User Profile” in the IIS application pool manually or you will be given the following error message:

Error accessing Website Microsoft Dynamics NAV 2017 Web Client
Type: Microsoft.Dynamics.Nav.Types.NavSecurityNegotiationException
Message: The Service Principal Name (Delegation) configuration has been set incorrectly. Server connect URL: “net.tcp://localhost:7046/DynamicsNAV365/Service”. SPN Identity: “DynamicsNAV/localhost:7046”
The X.509 certificate CN=XXXX, OU=PositiveSSL, OU=Domain Control Validated is not in the trusted people store. The X.509 certificate CN=XXXX, OU=PositiveSSL, OU=Domain Control Validated chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. The revocation function was unable to check revocation because the revocation server was offline.

Read the rest of this entry »

 
3 Comments

Posted by on 2017-03-13 in Okategoriserade

 

Tags: , , , , ,

Dynamics NAV: How To Consume An External SOAP Web Service With .Net/Dotnet Interop

EDIT 2018-12-04: Have added the last missing part to this post.
The reason for this blog post is that I needed to consume a web service from a partner company that give customer specific details. So far I haven’t worked with consuming web services in NAV so for me this is very new. This post is about the trial and errors that I had on the way implenting this in NAV 2015 on a Windows Server 2012 machine. My main objective was to solve this with dotnet interop.

Read the rest of this entry »

 
3 Comments

Posted by on 2017-02-25 in Okategoriserade

 

Tags: , , , , , , ,

Dynamics NAV Reports: Find Getdata Function With Report Builder

I have previously written a blog post (Dynamics NAV Reports (RDLC): SetData, GetData And Line Numbers) that explains how to easier see which number a certain data has in the setdata/getdata functions by using Visual Studio and line numbers. Unfortunately the most guides on the net that deals with getdata/setdata functions takes for granted that you are using Visual Studio with document outline but sometimes that choice isn’t available. Hopefully after this blog post you will find it easier to find the setdata/getdata functions in the report, know where to add a new field. If you only want to see which number a certain field has. Scroll to the bottom and you will find a list of the fields and numbers.

Read the rest of this entry »

 
3 Comments

Posted by on 2015-12-21 in Okategoriserade

 

Tags: , , ,

Visual Studio/Report Builder: Shortcut To Expression Window

When designing RDLC reports with Visual Studio or Report Builder how many times have you wished that you had a keyboard shortcut to get to the expression window? Well, I have wished it a lot of times! Then one day I went to a reporting class holdy by the guru Claus Lundstrøm and gave us a lot of useful tips. One among them was this.
Read the rest of this entry »

 
Leave a comment

Posted by on 2015-10-11 in Okategoriserade

 

Tags: , , , , ,

 
Stefan Maroń

Dynamics 365 Business Central

James Pearson

Thoughts about Dynamics 365 Business Central, Git, Azure DevOps, PowerShell, Automated Testing, Visual Studio Code...and maybe some other stuff

Roberto Stefanetti BLOG

MVP & MCT Business Central, Powershell, Azure, SQL Server

JoeBrown

DevOps starts with culture!

Comments for DevOps ABCs Blog

Reflections from the ERP field

DevOps ABCs Blog

Reflections from the ERP field

Dynamics 365 Business Central for Partners

Reflections from the ERP field

Freddys blog

Learn something new... - then Teach someone!

Stefano Demiliani Technical Blog

Reflections from the ERP field

David Worthington's NAV Performance Blog

Micosoft Dynamics NAV Performance Testing & Optimization

Freddys Blog

Reflections from the ERP field

Marije Brummel Blog | Business Central, Azure and more...

Design Patterns, Performance, Clean Code

Vjeko.com

Ideas in the cloud

Goprowe AB

Reflections from the ERP field

ArcherPoint

Reflections from the ERP field

The NAV Viking´s Blog

- Sharing my experience in the Dynamics NAV world

Comments for

Reflections from the ERP field

Nav Can Be Fun

Its Really Fun to Work with Microsoft Dynamics Nav / D365 Business Central

Navision-Girl.Com

Reflections from the ERP field