What’s new about interfaces in 2021 Wave 1

  • Post comments:3 Comments
  • Reading time:15 mins read

Microsoft Dynamics 365 Business Central 2021 Release Wave 1 is out (whoa, that was a mouthful) with some new perks for developers. Today, I had another live session at http://vjeko.live, and I made it both the first one in the series of What’s New for the latest release, as well as the episode four of Fun with Interfaces.

Interfaces are such an amazing feature in AL language, that was long missed, and that’s now saving my day nearly every time I do something with AL. The latest AL compiler (runtime “7.0”) comes with these new interesting features about interfaces:

  • You can mark interfaces for obsoletion.
  • You can mark individual interface functions for obsoletion.
  • You can return interfaces as return type from functions.
  • You can define UnknownValueImplementation for enums to specify the interface that represents any unknown enum values.

Let’s take a look at each one of those with examples.

(more…)

Continue ReadingWhat’s new about interfaces in 2021 Wave 1

Resident control add-ins – no SingleInstance

  • Post comments:0 Comments
  • Reading time:17 mins read

My last topic was resident control add-ins. In my video and written blog I’ve explained what they are and how you can quickly have them up and running. However, there was one particular thing I said I generally don’t like – single-instance codeunits. So my second blog on this topic focuses precisely on that: how to make your control add-in available to your AL code from everywhere, without having to rely on a single-instance codeunit.

(more…)

Continue ReadingResident control add-ins – no SingleInstance

A couple of ideas for HttpClient

  • Post comments:1 Comment
  • Reading time:18 mins read

When invoking any REST web services, a lot of AL code mostly looks like this:

procedure CallRESTFoo()
var
    Client: HttpClient;
    Response: HttpResponseMessage;
    Body: Text;
    Json: JsonObject;
begin
    Client.Get('https://foo.bar/', Response);
    Response.Content.ReadAs(Body);
    Json.ReadFrom(Body);
    // Process JSON body of the response...
end;

Of course, there are more things there, like headers or perhaps calling HTTP POST (or another method) instead of GET, but when you strip it down to the bones, the chunk above is what remains.

Today’s post is a follow up for my HttpClient Patterns live session on http://vjeko.live/ and as I promised, I am providing the text-only version for those who prefer reading to watching.

(more…)

Continue ReadingA couple of ideas for HttpClient

Fun with Interfaces: Testing

  • Post comments:2 Comments
  • Reading time:4 mins read

Oh how much fun we had today on my live stream, it’s just amazing. First, all the viewers had fun of waiting for me to go live for nearly an hour, and then at some point I managed to unplug my reflector. Perks of live streaming 😁

First of all, I would like to – once again – apologize to everyone who waited for me to go live. I’ll explain in the end of this blog what really happened. For now, let’s go on-topic.

(more…)

Continue ReadingFun with Interfaces: Testing

Fun with Interfaces

  • Post comments:4 Comments
  • Reading time:2 mins read

Today I've streamed the Fun with Interfaces video blog at https://www.youtube.com/watch?v=QSMHL32c5mg and the recording is now published online. This was the first session I ever delivered about interfaces, and I…

Continue ReadingFun with Interfaces