OAuth for Business Central On-Premises Service to Service Authentication
Andrei Lungu Blog
by Andrei
2y ago
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 also worked on a related task recently, I thought it would be interesting to write about it. The example is about Service to Service Authentication into Business Central and not OAuth authentication with user interaction. I think that many integrations will use this ..read more
Visit website
How to create a generic “Middle Tier” for BC Web Services using Azure Functions
Andrei Lungu Blog
by Andrei
2y ago
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 responses from BC – sends responses back to external app. Some advantages of this are: – the “middle tier” could handle BC authentication. – the “middle tier” could make some transformation of the request data sent by the external app and then send request to BC in a different wa ..read more
Visit website
How to SetCurrentKey to Sort in a RecordRef – Nav / D365 Business Central
Andrei Lungu Blog
by Andrei
2y ago
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 primary key is on field “PK” and we also have a secondary key on field “Replication Counter”: table 50100 Test { Caption = 'Test'; fields { field(1; PK; Integer) {} field(2; "Replication Counter"; Integer) {} } keys { key(PK; PK ..read more
Visit website
An example of how to use D365 Business Central Interfaces
Andrei Lungu Blog
by Andrei
3y ago
Introduction I did not write on the blog for a long time because I was too busy working on projects and was not in the mood for blogging. But today I want to write about the new concept of abstraction introduced in AL in 2020: D365 Business Central interfaces. So, first what are interfaces and why use them? Interfaces are somehow like codeunits, excepting that an interface can only contain method signatures(name, parameters), not also the implementation of these methods. Interfaces are a way to achieve polymorphism. Polymorphism means “to have many forms”, so an interface can be used to call f ..read more
Visit website
Cross Session Events and SELECTLATESTVERSION – MS Dynamisc Nav / Business Central
Andrei Lungu Blog
by Andrei
4y ago
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 Session based on something else that happened on a different session that runs on a different server instance. We do this by implementing a custom Publisher and Listener (subscriber) pattern to bind the two sessions. Process First let me present the process of the integration. We ..read more
Visit website
How to Use Recursion to Handle Pagination with Continuation Tokens in a D365 Business Central JSON API Integration
Andrei Lungu Blog
by Andrei
4y ago
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 response, it contains a data array with customer elements and after that, information about the Continuation Token: –> This means that you first need to create a request to the API Endpoint and then check if there is a Continuation Token or not. If t ..read more
Visit website
Use Unix Time Stamp to Calculate Expires_On from Web Service Response in Business Central AL
Andrei Lungu Blog
by Andrei
4y ago
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)’. Problem Description –> As I was working at an API integration I went through an interesting task: web service uses OAuth2.0 for authentication, so first we need to generate a Bearer Token using the authentication Endpoint. In Postman request and response looks like this: –> As ..read more
Visit website
Global Payments API Integration for Dynamics NAV LS Retail
Andrei Lungu Blog
by Andrei
4y ago
Introduction This sample project is one of the many integrations I designed and developed. It allows customer that uses Dynamics NAV and LS Retail POS System to receive credit card payments and send payment information to Global Payments API in order to process the transactions. If you don’t know what Global Payments API is, check out this link. Setup 1) First we have a setup table for each Pos Terminal. Here we specify API Endpoints and other settings: Notice that the web service required to send a token with all requests, into the Request Headers. The token we create expires in 24 hours. Th ..read more
Visit website
Read/Write Text Data From/To BLOB Fields in a Generic Way- Nav
Andrei Lungu Blog
by Andrei
4y ago
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 to store some tokens used for an API integration. The tokens were very long, exceeding the 250 max. characters of a Nav Text field. The values of the two fields are displayed and written into the table by using following actions: An ..read more
Visit website
Distance Calculator for Business Central – Another way to Import Response from Web Service into Business Central Wave 2
Andrei Lungu Blog
by Andrei
4y ago
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 XML or JSON data received from any Web Service into Business Central Wave 2. At the end you can find a Github link with all files of the extension. We will use the same example with the Google Maps API. But now we build a more generic solution (Distance Calculator for Business Central ..read more
Visit website

Follow Andrei Lungu Blog on FeedSpot

Continue with Google
Continue with Apple
OR