OAuth for Business Central On-Premises Service to Service Authentication

Introduction There are already many great posts online and even Microsoft presentations that explain how to Authenticate to Business Central using OAuth 2.0. But most of them are focused on the cloud version. As I’ve been asked to blog about how OAuth 2.0 Business Central Authentication can be used for the On-Premise version and I…

How to create a generic “Middle Tier” for BC Web Services using Azure Functions

Introduction There might be situations when an external app needs to use Business Central web services but you don’t want it to access directly the BC web service. Instead we can have something like a “middle tier” app which does the following: – receives requests from external world, – sends requests to BC – receives…

How to SetCurrentKey to Sort in a RecordRef – Nav / D365 Business Central

Recently I had the need to use a Secondary Key to sort a RecordRef. As I could not find another clear example, I decided to share my solution here. Introduction To make it easier to understand, let’s assume we have this Test table with only 2 fields, both Integers just to simply the example: The…

Cross Session Events and SELECTLATESTVERSION – MS Dynamisc Nav / Business Central

Introduction Recently I worked on something very interesting related to a integration between MS Dynamics Nav and an external payment service provider. I had to use custom Cross Session Events to solve a problem which I think it’s worth sharing. So this why this post. Basically, it is about doing some action in a NAV…

How to Use Recursion to Handle Pagination with Continuation Tokens in a D365 Business Central JSON API Integration

Introduction Recently I encountered the following situation in Business Central with Web Service that uses Pagination with Continuation Tokens: –> When you get data from Web Service and it returns a lot of results, the data is paginated. –> One method to handle pagination is using Continuation Tokens. –> For example, look at the below…

Use Unix Time Stamp to Calculate Expires_On from Web Service Response in Business Central AL

What is a Unix Time Stamp? As per Wikipedia, a Unix Time Stamp is a BigInteger value that represents the number of seconds that elapsed since the time 00:00:00 UTC on 1 January 1970. For example using this converter you can see that the Unix Time Stamp ‘1588400673’ represents date time ’05/02/2020 @ 6:24am (UTC)’.…

Read/Write Text Data From/To BLOB Fields in a Generic Way- Nav

Introduction Because this post https://andreilungu.com/read-write-text-from-to-blob-field-nav/ is one of the most read posts from my blog, I decided to write about how to read/write data from/to multiple blob fields in a generic way (without duplicating code). Functional description For example, I used this when I had 2 BLOB fields in a setup table where I needed…

Distance Calculator for Business Central – Another way to Import Response from Web Service into Business Central Wave 2

Introduction In this post I presented a very simple way to import data from Web Service Response into Business Central Wave 2. However, that approach is not a generic one. Let’s now create a Distance Calculator for Business Central that can be used in real life. The current post presents a better way to Import…