Skip to main content

Posts

Showing posts from May, 2019

Workaround to XMLPort not supported in Business Central

Problem Statement:
While I was working on some custom EFT project, I thought of using XMLPort as it is the safest and easiest method to get the data successfully directly from the tables.
Unfortunately, XMLPort is not supported to work on WebClient and I was stuck with writing code to do exactly what XMLPort would do.
Also, another issue that Business Central d extension support is using File methods i.e Open, Write, Close, etc.









Introduction:
In Business Central even if you're not given explicit rights to deal with files directly there are streams using which we can be downloaded as files. Enough of introduction, let's start working now!

Books & References:
https://docs.microsoft.com/en-us/dynamics-nav/feature-limitations-of-the-microsoft-dynamics-nav-web-client
Pre-requisites:

VS CodeAL Language ExtensionMicrosoft Dynamics Business Central.
Demonstration:
1. Creation of File Contents:
In this case, I've simply text string 'Hello World!'
Although it's perfectly po…

Generate Number Series from one Company and use it in another company

Introduction:
When dealing with Number Series where the Intercompany Documents are created automatically using the code, using standard number series generation Codeunits cause problems. In this blog, I'll be explaining why this issue is caused and how to resolve such issues.
Pre-requisites: Microsoft Dynamics NAV / Business Central VS Code AL Language Extension
Solution: Issue: Let's say I'm logged in as user of Company B. When I create Sales Order in current company, I need to create Purchase Order in target company say Company A. When I use the Number Series declared on Company B's Purchase and Payable Setup for Purchase Order, the system either gives an error that Number Series does not exist or number generated is out of sync as Number Series are stored on Per Company basis. This results in overlapping of next PO number to be generated.
Cause of the Issue: NoSeriesManagement Codeunit 396 works only with the No. Series for the current company. Because of this if the No.…

Creating APIs in Business Central - 1

Introduction:
While writing a blog on Automated Testing in Business Central, I was going through sample apps provided by Microsoft and realized that the complexity is nowhere close to what examples Microsoft has provided on docs.microsoft.com. In this blog, I will try to explain how APIs work and how to be creative with the implementation. Also, an API which were in beta are finally out with version V1.0 in the April 2019 release let's see some important key things from development aspects.
This blog is going to be theoretical one kindly bear with me.


Pre-requisites:
Microsoft Dynamics Business Central (SaaS)VS Code(https://code.visualstudio.com/download)AL Language Extension(https://tinyurl.com/yyvzxwkb)API V1 from Business Central On-Premise DVD
Books & References:
API V1 from Business Central On-Premise DVDAPI(V1.0) for Business Central (Click Here)API(Beta) for Business Central (Click Here)
Solution:

Key Requirements:
API source table must have an Id(GUID) field per record for m…

Test Toolkit in Business Central(SaaS) - How to setup and execute Custom Test Cases

Introduction:
Test Automation is basically writing code to test and verify whether the application functionality developed works as expected. When you install NAV / Business Central - OnPremise, the installation folder consists of standard Test Toolkit Objects which are to be imported manually if you want to enable Test Automation in your project. But, for Business Central (SaaS) it comes pre-installed.  Let us see how Test Automation is done in Business Central(SaaS) with the help of Test Toolkit and how to set up your own test cases for the customization you've developed for the system.

Books & Reference: 1. Automated Testing in Microsoft Dynamics 365 Business Central (https://tinyurl.com/y3zpy27p) Pre-requisites:
Microsoft Dynamics Business Central (SaaS)
VS Code(https://code.visualstudio.com/download)
AL Language Extension(https://tinyurl.com/yyvzxwkb)

Demonstration:
1. Checking the installed Test Toolkit in Business Central(SaaS):
When searching for Test Tool in Business Cen…

Enum Object in Business Central - How to create and how to extend!

Introduction:
Since the dawn of Business Central Era (2nd April 2018 - Today), there are many new data types introduced by Microsoft.
One such data type is Enum(Enumeration). Essentially, what enumeration is having a single select value with multiple options at a given time!
Well, I know what your thinking what about the 'Option' data type.
Anyways, enough of talking let's just dive in!

Disclaimer:The knowledge in this blog is true and complete to the best of authors and publishers knowledge. The author and publisher disclaim any liability in connection with the use of this information.
Pre-requisites:
Microsoft Dynamics Business Central (SaaS or On-Premise)
VS code with AL Language extension

Code:
1. Enum as an Object:
Just like Tables and Pages, Enum behaves like an Object.
Note that Extensible means that the Enum Object can be extended in another module. By default, this property is set to TRUE.



Enums and Enum Extensions behave differently. They follow a different number se…