Webservice to Business Central – Challenge

Offering business central webservices to the world is made easy in this ERP system. Offering fast, reliable webservices is somewhat more challenging.

When you first start with webservices, and a customer ask the question: ‘I have and android app with which I pick articles for a weborder. When the weborder is picked completely on de device, I want to send the info to Business Central, and post and print immediately, so I can put the printed invoice in the box, and a label on the box. We did just that.
(It’s a little more complicated in Nav terms… register a pick, post a warehouse shipment, post a sales shipment and generated the label, post an invoice and print it… at the correct workplace of the device user but for terms of simplicity this is ignored.)
But then some strange things start happening… multiple devices do this simultaneous on picks on the same warehouse shipment, etc… And online users also to things. So locking and deadlock issues occur.

And fixing those took lot more time than initially expected.

So be careful and think deeply on how the webservices will be used in the multi-user world. A device user has no Business Central page on which he can take action in a simple manner.


30+ year programming experience, and still…

Creating a programming error still is simple, and AI isn’t helping me yet.

I develop software for Microsoft Business Central, in a programming language called C/AL (and in de current version this is changed to AL).

Today in a hurry, bugfixing job, I introduced a new error. The code was more than one page long, and I used a for loop with a local variable _i.
And then I nested two for loops…

for _i := 0 to n do begin

// … a bunch of code for the rest of the page
for _i := 0 to m do begin
//create a record and insert into the database
// and m begin typically begin 1 or 2 and n going to 40 or so.

And so I created an infinite loop, for the first time in years.
In C/AL this was inside a transaction, so the table got locked, users complained, and I was able to kill the process. But it had to rollback the transaction. And it already contained +3.5 million records before the message reached us.

And although this is legit coding (or how should the compiler know?), reusing _i in a second inner loop.
With all AI stuff currently available, I hope for a compiler warning at least.



Midden maart de lockdown. Ik werk in Eindhoven, en mijn laatste dag was 13 maart. Op het einde van de dag heb ik tegen mijn collega’s gezegd… tot volgend jaar. Hilariteit, dat is toch wel erg pessimistisch,… Maar nu is het kerst, en ik het afgelopen jaar ben ik 1 dag op kantoor geweest (ik programmeer, dus dat kan perfect vanuit thuis). En nu zit het werkjaar erop, want ik heb vrij tussen kerst en nieuw 2020.
En het is waarschijnlijk dat het niet voor de zomer voorbij zal zijn. Met de huidige tijdlijn van de vaccinaties in Belgie zal het nog een tijdje duren voor we aan +70% van de bevolking zitten.

De herfst 2021 lijkt mij nu eerder de streefdatum waarop de meerderheid ingeënt zal zijn, en we naar een meer normaal leven kunnen.

Laat ons daarop hopen.


Business Central Error

We are trying to deploy a mega app to Business Central 16 (spring 2020) and get an ‘Object reference not set to an instance of an object’ in Microsoft.Dynamics.Nav.Management.dll.

With some help of the mibuso forum and the poster of the original problem there, we have found the error and could solve it.

Finding the root problem involves installing visual studio (enterprise in our case) on the business central server, attaching to the Nav server.exe process for debugging and deploying when de debugger is attached.

You will get into the debugger at the moment of the error in the deployment. We’ve got a neat error on the callstack, pointing out the object which is being processed at the time of the error, and the statement which is causing the problem. Not why it’s a problem, but you get some idea.
In our case it seams to be the use of a global Boolean called Update which is initialized to True in the OnPageOpen of the requestpage of the report.
Removing this initialization on that particular place in code resolves the issue.

Vintage Computing


As I described earlier, 2 keys on the keyboard of my new Apple IIe computer do not work. I ordered some second hand replacements on Ebay. They come from Stephen Buggie, a Professor Emeritus at the university of New Mexico. They arrived by mail a few days ago.

Now it’s finding time to do some soldering again… And as far as I can see now, these are the last repairs needed on this machine 😉

Vintage Computing


In the early eighties I owned an Apple II computer. After I bought an IBM-AT compatable computer mid eighties, I sold the Apple II and never looked at it again. But in October this year in a nostalgic moot, I bought an Apple IIe.

Having sold all my disks together with the computer, I was happy to see the online software archives available now, where I can find all kinds of software I once owned. I never guest the scene of Apple II enthusiasts is so big, and so many software is still going around after all those years.

When looking for options to get the software on the Apple II, I saw several pieces of hardware developed over time. But the floppy-emu, was the only one currently available for shipping. So I bought 2 of them and I can use them as two drives like I had in the past.

Now I’m able to run UCSD Pascal from two drives, not needing to swap floppies for compiling. But there is still a problem. Although I was fluid in UCSD Pascal in the eighties, this is not the case anymore in 2020 it seems. All those thousands of lines of code I wrote back then, seem to be far, far away.

Vintage Computing

Apple IIe Replacement PSU

I ordered a bunch of capacitors to replace all of them on the defective PSU. Mainwhile, I did not want to wait. So I ordered a replacement power supply from ReactiveMicro. The original PSU will be restored, but… not for now.

The new PSU arrived today and was installed in minutes and the Apple IIe is working fine now.

The next project is replacing some of the keyswitches which are not working well. First I will try a cleanup, but for as far as I can see now,a replacement is in order. ebay, here I come.

Vintage Computing

Apple IIe PSU dead

It can happen… Starting my vintage Apple IIe computer, crackles and smoke. I switched it off fast, when it still seemed to be working.

Some work done to remove the PSU and open it up. And yes, capacitor C1 has blown. So I now ordered a full set of replacement caps.

Now lets hope the replacement set arrive soon and nothing more has gone wrong besides the blown cap.


C# en Web Reference vs. Service Reference

Er zijn nog steeds verschillende mensen die verward raken door het verschil van deze 2 manieren om een webservice te gebruiken in een visual studio C# applicatie.

Add Web Reference: de ‘oude’ manier van werken, gebruik makende van de XmlSerializer. De gegenereerde code is in vele projecten bruikbaar (Web App, Web Site, Console toepassing, winforms toepassing…)

Add Service Reference: de nieuwere manier van werken die een WCF service reference toevoegd. Dit is ‘moderner’ en geeft je meer mogelijkheden om in te grijpen in de communciatielaag.

Het gebruik van de code is op de ‘oude’ manier iets eenvoudiger. Echter is dat een afweging tegen de nieuwe mogelijkheden.

Voorbeeld nieuwe code (servicereference):

binding.Name = "mve1";
binding.Security.Mode = BasicHttpsSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;

Uri baseAddress = new Uri("");
EndpointAddress addr = new EndpointAddress(baseAddress);

var client = new ICSGeneral.CSGeneral_PortClient(binding, addr);
           System.ServiceModel.Security.UserNamePasswordClientCredential cre = client.ClientCredentials.UserName;
cre.UserName = @"uuuuuuuuuuu";
cre.Password = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy";

string result = client.GetItemVariantInfoByCrossRef("2013111427275", "90-CM", true, true);

Voorbeeld oude code (webreference)

TestDmaCall.ICSGeneral ws = new TestDmaCall.ICSGeneral();
ws.Credentials = new System.Net.NetworkCredential("userid", "passwordtoken");
ws.Url =";        
string result = ws.GetItemVariantInfoByCrossRef("2013111427275", "90-CM", true, true);


Avond Opleiding

In 2016 heb ik de avondopleiding bij CVO De Verdieping in ontdekt. En sindsdien ben ik een vaste cursist aan deze school.
Een avond van de week besteden aan het leren van iets nieuws, samen met medecursisten. Het is een mooie hobby, en zo heb ik ook al veel leuke mensen leren kennen.
Echter op het einde van de zomervakantie was mijn inschatting dat we de winter wederom niet op een normale manier zouden doorkomen. De opleidingen schakelen over naar online lesvolgen. En voor bepaalde opleidingen is dat moeilijk.

Gelukkig heb ik voor de tweede van dit jaar gekozen voor een online informatica opleiding (Power-BI). Toch nog wat verbonden met school en perfect mogelijk vanuit thuis.

‘Best of both worlds’ in deze tijden.