Monday, 26 September 2022

Extension Unpublished/Uninstalled history required in BC Production environment

 There is a situation when someone can uninstall or unpublish any APP extension from the extension management in Production environment, there should be a feature available so that we should know who had uninstalled/unpublished that extension with their User name, Date and Time.

Vote to my question:

👍👍👍👍

Vote Here

Friday, 16 September 2022

README.md (Markdown) file in AL Code for writing your version control or project definition details

 Sometimes it can be easy if put all the information in one place related what we changed in our AL extension specially when there are multiple developers are working together,

use of Markdown file.

Is it best idea?

Yes, unlike a documentation trigger of each object, I would say this is the file README.md can be your whole Project's documentation trigger 👀 Called MarkDown

How to use it?

Just visit your AL code, create a new file and name it with a README.md.

see below 👇


  • 2nd


  • 3rd interesting part > Write your own documentation 👲
Start writing your version control or anything else here we go, and then click on Right hand corner button (Open Preview)


See how it looks like :



We have some cool features and market extension
Use me to check those out


Enjoy 👦👦👦

Wednesday, 14 September 2022

Can we choose the right environment before Publishing the BC App?

Yes, there is way we can define or modify our launch.json file in such a way that before publishing any custom app it ask me to the right environment to publish.

See below

Open the lanuch.json file from your app file.

Put the new configuration schema as many environment you have like I do.

In my case I do have two environment

1. Dev_Sandbox

2. Test_Sandbox



Save it and try to Publish or Download the symbol

So I am trying to download the symbol, as soon as you hit that command Command line will start show you which environment you want to choose so that you can download the symbol in same.

The same sandbox name we defined earlier start flowing here. 



Choose the one and enjoy :)



Tuesday, 6 September 2022

What is New in 20.5 BC?

 What is New in 20.5 BC?

See the details here

Upgrade to 20.5

Please note that new customers will automatically get the latest builds of Business Central (20.5). If you are an existing partner/customer, you will receive an email notification as soon as your environment has been upgraded.

Download the latest OnPrem version from here



Source 👆

Barcode Generator in Business Central 2

 

Generate a barcode in Business Central #BC of different type like EN128, EN8, EN39 or EN13 with custom code and without using any API, it can be used for lifetime without any subscription.

It also working with mobile scanner too. :)

Download the Git Here
#BC
#barcodelabels
#businesscentral
#barcodescanners

Friday, 2 September 2022

Prepare for major updates with preview environments for Wave 2 Busines Central 2022 (21)

 

Preview Environments for Business Central Wave 2 (2022, 21)



About one month before a major update, you can try out new functionality in preview environments. Preview environments are Business Central online sandbox environments that you create on a preview version of the application. When you create the new sandbox environment, choose the preview version marked as (Preview) from the version list. This way, you get a new sandbox environment with a preview version of the application.

Source - Documentation

you can start using preview environment for following purpose

Review the new functionality. Try it out, and begin training employees on the new features that are coming.

Validate your extensions.

Upload and install your extensions into the sandbox environments created on the preview version and run through the functionality. Verify that the customization continues to work and is compatible with the new version.

In rare cases, if you discover any changes required for your per-tenant extension to become compatible with the next release, apply the changes to your app, test it again on a sandbox environment running on a preview version. Then, if tests complete successfully, upload the app into your production environment, setting the Deploy to field to Next major version. This way, the compatible version of your app will be used when you schedule the upgrade of your production environment to the new major update once it becomes available.

Test the quality. If you run into issues related to the preview, please provide feedback on Collaborate.



Thursday, 25 August 2022

Azure Logic app with Business Central

 Azure Logic app with Business Central

In this video I will show you how you can configure Azure logic app and then connect with Business central.

I am taking an example to create a Customer records in Business central and sending a notification to the user email.

For more information about the logic app connection, triggers etc. please Click here





Tuesday, 23 August 2022

Data Upgrade Extension using AL Code

 Data Upgrade Extension using AL Code

This article provides information about how to make a newer version of extension upgrade available on tenants. The first phase of the process is to develop the extension for upgrading. In this phase, you add code to upgrade data from the previous extension version. Once you have the upgrade code in place, you can publish and synchronize the new version, and the run the data upgrade.

When you develop a new extension version, you must consider the data from the previous version. Determine the modifications that must be made to the data to make it compatible with the current version. For example, maybe the new version adds a new field that needs default values set for existing records. Or, the new version adds new tables that must be linked to existing records. To address this type of data handling, you must write upgrade code for the extension version. If there are no data changes between the extension versions, you don't need to write upgrade code. All data that isn't modified by upgrade code will automatically be available when the process completes.

Source : Documents Library



Thursday, 30 June 2022

Microsoft Business Central solution for Boolean switch problem in the browser (for Onprem version)

Microsoft Dynamics Business Central Boolean Switch problem on Chrome and Edge browser

Bug?

Currently, all Dynamics 365 Business Central SaaS clients running Booleans or Demos on Chrome and/or Edge browser are finding the browsers are shifting true/false fields in BC over the captions of certain fields.

Why its happening?

All pages throughout the system with Boolean Fields (true/false) flags have a bug where the Boolean is getting pushed to the top of the fast tab and hiding the caption for other fields as shown below from a customer card example:

Can we Fix it?

To fix the problem in SaaS version, Microsoft is working already on the issue



To solve this problem OnPrem version, there is solution to modify the desktopPreview.CSS file in our InetPub folder as per below

Note: BC180 can be your local version folder




Now save this file to Desktop and open in Note pad and find the below Tag, and remove the below Yellow Property from the tab

Save this file and copy and paste into your original folder.

.booleancontrol-toggle-switch-container .edit-container .input-wrapper{display: inline-flex;

Now open the browser and check again, issue resolved.




Wednesday, 18 May 2022

Publish all dependent app altogether in Visual studio Code AL

Now easy to Publish all dependent app altogether with the following command

There are few apps which we work on and also have some other app nested, and need to take care before publish the main app, either the other dependent app is already installed, so no to worry, now we have a command which takes care about to install each dependent app with the main app.


 


Publish full dependency tree for active project :

This command traverses all the dependency tree, starting from the current project and going to all the projects loaded into the workspace


See the below screen shot, all the apps including main app installed together, this is the new and cool feature to upload or publish all the app together.



Monday, 11 April 2022

OAuth2.0 Token authentication with AL code for Business central

 OAuth2.0 Token authentication with AL code for Business central - Part 2

In our last video (Part 1) we have been gone through the Token authentication using Postman, App registration with Azure portal, in this part I am showing how we can generate the token and authentication with web api using AL code.




Thursday, 7 April 2022

BC OAuth2 0 Token Based Authentication

BC OAuth2 0 Token Based Authentication (Part -1)

About OAuth

OAuth is an open standard for authorizing access to web services and APIs from native clients and websites in Azure Active Directory (Azure AD). In Business Central, OAuth is useful when your deployment is configured for Azure Active Directory authentication, either through your own Azure subscription or a Microsoft 365 subscription. OAuth lets users sign in to Business Central web services using their Microsoft 365 or Azure AD credentials. Otherwise, they would have to use their Business Central account credentials (user name and password or web access key).

Part 2 - (oAuth2.0 validation through AL Code)

Steps to be followed









Sunday, 20 March 2022

Print QR Code in PaySlip with LS Retail NAV 2016

 I found one of the the method and DLL file which is being used in below code to generate the particular width and height of the QR code in Pay slip.

Note: please check your thermal or Zebra printer setting to print QR code image.


Declarations of Variables

Name DataType Subtype Length

EncodingOption DotNet ZXing.Common.EncodingOptions.'zxing, Version=0.16.6.0, Culture=neutral, PublicKeyToken=830ae994e36ac27d'

BarcodeWriter DotNet ZXing.BarcodeWriter.'zxing, Version=0.16.6.0, Culture=neutral, PublicKeyToken=830ae994e36ac27d'

Barcodeformat DotNet ZXing.BarcodeFormat.'zxing, Version=0.16.6.0, Culture=neutral, PublicKeyToken=830ae994e36ac27d'

BitMatrix DotNet ZXing.Common.BitMatrix.'zxing, Version=0.16.6.0, Culture=neutral, PublicKeyToken=830ae994e36ac27d'

QrCodeBitmap DotNet System.Drawing.Bitmap.'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

ImageFormat DotNet System.Drawing.Imaging.ImageFormat.'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Zing DLL download here.

LOCAL GenerateQRCode(TexttoQR : Text) QRPath : Text

      EncodingOption := EncodingOption.EncodingOptions();

      EncodingOption.Height := 200;

      EncodingOption.Width := 200;


      BarcodeWriter := BarcodeWriter.BarcodeWriter();

      BarcodeWriter.Format := Barcodeformat.QR_CODE;

      BarcodeWriter.Options := EncodingOption;

      BitMatrix := BarcodeWriter.Encode(TexttoQR);

      QrCodeBitmap := BarcodeWriter.Write(BitMatrix);


      ServerFileName:=COPYSTR(FileManagement.ServerTempFileName(BmpFormat),1,250);

      QrCodeBitmap.Save(ServerFileName, ImageFormat.Bmp);

      ClientFileName:=FileManagement.ClientTempFileName('');

      FileManagement.DownloadToFile(ServerFileName,ClientFileName);


      FileManagement.BLOBImport(TempBlob,ClientFileName);


      FileManagement.BLOBImportFromServerFile(TempBlob, ClientFileName);

      QRPath := FileManagement.BLOBExport(TempBlob, 'InvQrCode.jpg',FALSE);

      EXIT(QRPath);

Thursday, 10 March 2022

Business Central 2021 release wave 2 - Preview Environments.

Business Central 2021 release wave 2 - Preview Environments.


Preview environments are Business Central online sandbox environments that you create on a preview version of the application. When you create the new sandbox environment, choose the preview version marked as (Preview) from the version list. This way, you get a new sandbox environment with a preview version of the application

The newly created preview sandbox environment contains demonstration company data. Trying the preview on a copy of your current production data is not yet supported; nor is testing the upgrade from your current version to the preview. However, you can use the newly created sandbox environment for exploring and learning the new product capabilities. You can also use the preview environment to validate that any per-tenant extensions are still working as expected.



Note: You will be able to test the update on a copy of your production data in a sandbox environment when we release the new update in production in April or October, respectively. When the official release becomes available, you can continue your tests on that version. You will no longer be able to create new preview sandboxes.

 Important

The preview version as well as all sandbox environments that are based on it will be removed 30 days after the official release becomes available.

The following figure illustrates the suggested steps for getting a preview of a major update with example dates for the two release waves in any given calendar year.






Thursday, 3 February 2022

Using Snapshot Debugger in Business Central Production Envionment

 Snapshot Debugger in Business Central  Production Environment

Snapshot debugging allows recording AL code that runs on the server, and once it has run, debug the recorded snapshot in Visual Studio Code. To create and download a snapshot file that exists on the server on behalf of an end-user, the user must be part of the D365 Snapshot Debug permission set. For more information, see Assign Permissions to Users and Groups. One of the advantages of snapshot debugging is that it provides the ability to inspect code execution and variables in the production environment in a cloud service, on a specified user session.

Snapshot debugging introduces the concept of snappoints. A snappoint is a breakpoint in Visual Studio Code that is set when creating a snapshot, they do not, however, stop execution of code like when using regular debugging. Snappoints instruct execution to log the state at the breakpoint for later offline inspection. Snapshot debugging will record AL code as it runs on the server, but will only collect variable information on:


Snappoints

AL exceptions


Ref. : Dynamics 365 Business Central: using snapshot debugging – Stefano Demiliani


Video Link : BC Snapshot Debugger





Monday, 1 November 2021

Generate QR code in Business Central using Third party Webservice link

AL Code as per below

Create New Report with having barcode image.


In RDL design add image type control and put the barcod2 variable into that like we do normally for Picture control.


report 50999 QRCodeList
{
    Caption = 'QRCode List Report';
    UsageCategory = Administration;
    ApplicationArea = All;
    DefaultLayout = RDLC;
    RDLCLayout = '.\Report\QRCodeList.rdl';
    dataset
    {
        dataitem("Sales Header"; "Sales Header")
        {
            column(No_; "No.")
            {

            }
            column(temp; barcode2)
            {

            }
            trigger OnAfterGetRecord()
            begin                
                barcode2 := InitArguments("No.");
            end;
        }
    }


Global Variable

  var
        BarCode2: text;



local procedure InitArguments(ItemNo: text): text
    var
        BaseURL: Text;
        Base64Convert: Codeunit "Base64 Convert";
        TempBlob: Codeunit "Temp Blob";
        TypeHelper: Codeunit "Type Helper";
        client: HttpClient;
        response: HttpResponseMessage;
        InStr: InStream;

    begin
        client.get('https://barcode.tec-it.com/barcode.ashx?data=' + itemno + '&code=QRCode', response);
        TempBlob.CreateInStream(InStr);
        response.Content().ReadAs(InStr);
        BarCode2 := Base64Convert.ToBase64(InStr);
        exit(BarCode2);
    end;



Run the report in BC and see the output, it will give you a QR Code as image.



Thursday, 21 October 2021

Visual Studio Code is now available on the web. No more OS dependency .

 Visual Studio Code is now available on the web. No more OS dependency .



Source:

Bringing VS Code to the browser#

Fast forward to today. Now when you go to https://vscode.dev, you'll be presented with a lightweight version of VS Code running fully in the browser. Open a folder on your local machine and start coding.

No install required.

Readmore

Sunday, 19 September 2021

Convert each word's first letter in Capital

 Convert each word's first letter in Capital

Below is the code

Name DataType Subtype Length

nametext Text

newtext Text

ucase Text

textlen Integer

Convertext Text


nametext := 'first letter of this line going to be converted in Capital.';

WHILE STRPOS(nametext,' ') <> 0 DO BEGIN

  newtext := UPPERCASE(COPYSTR(COPYSTR(nametext,1,STRPOS(nametext,' ')-1),1,1));

  newtext += LOWERCASE(COPYSTR(nametext,2,STRPOS(nametext,' ')-2)) + ' ';

  Convertext += newtext;

  textlen := STRLEN(newtext);

  nametext := DELSTR(nametext,1,textlen);

END;

ucase := UPPERCASE(COPYSTR(nametext,1,1));

ucase += LOWERCASE(COPYSTR(nametext,2,STRLEN(nametext)));

MESSAGE(Convertext+ucase);











Monday, 12 July 2021

Create vCard QR Codes using Azure Functions

Create vCard QR Codes using Azure Functions

 QR Code Generation in BC with Azure functions


Source : https://carlos.mendible.com/2016/08/28/create-vcard-qr-codes-using-azure-functions/


1. Create a Function App


Head to portal.azure.com and hit the New button. Search for Function App and create one. You’ll be asked for an app name, resource group, app service plan and storage account where the code will live.

2. Create the function


Create a new Function, selecting the empty C# template and give it a name: (i.e QRCoder)

3. Add the code


Replace the contents of the Code (run.csx) section with the following code and save it:

Sunday, 11 July 2021

Generate QR Code from NAV 2016

 How to General QR Code from NAV 2016


1. Using of Microsoft.Dynamics.Nav.MX.dll, you can find the DLL fine the below path from your installation folder or from the DVD folder.

...ServiceTier\program files\Microsoft Dynamics NAV\90\Service\Add-ins\ElectronicInvoice


Create a Codeunit object or use any object to create below functions.

CreateQRCodeInput

GetQRCode

GetBarCodeProvider

MoveToMagicPath

GenerateQRCode

LOCAL CreateQRCodeInput(Name : Text;VATNo : Text;InvDateTime : Text;TotalAmt : Text;VATAmt : Text) QRCodeInput : Text[1024]

Var Name DataType Subtype Length

No Name Text

No VATNo Text

No InvDateTime Text

No TotalAmt Text

No VATAmt Text

QRCodeInput :='Seller Name:' + Name + ';' +'VAT No.:' + VATNo + ';' +'TimeStamp:' + InvDateTime + ';' +'Total Amt:' + TotalAmt + ';' + VATAmt;


LOCAL GetQRCode(QRCodeInput : Text) QRCodeFileName : Text[1024]

Parameters:

Var Name DataType Subtype Length

No QRCodeInput Text

Local Variables:

Name DataType Subtype Length

 Set RunOnClient = Yes on DotNetVariables

IBarCodeProvider DotNet Microsoft.Dynamics.Nav.MX.BarcodeProviders.IBarcodeProvider.'Microsoft.Dynamics.Nav.MX, Version=11.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'



GetBarCodeProvider(IBarCodeProvider);

QRCodeFileName := IBarCodeProvider.GetBarcode(QRCodeInput);


LOCAL GetBarCodeProvider(VAR IBarCodeProvider : DotNet "Microsoft.Dynamics.Nav.MX.BarcodeProviders.IBarcodeProvider")

Parameters:

Var Name DataType Subtype Length

 Set RunOnClient = Yes on DotNetVariables

Yes IBarCodeProvider DotNet Microsoft.Dynamics.Nav.MX.BarcodeProviders.IBarcodeProvider.'Microsoft.Dynamics.Nav.MX, Version=11.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

Local Variables:

Name DataType Subtype Length

QRCodeProvider DotNet Microsoft.Dynamics.Nav.MX.BarcodeProviders.QRCodeProvider.'Microsoft.Dynamics.Nav.MX, Version=11.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

 QRCodeProvider := QRCodeProvider.QRCodeProvider;

IBarCodeProvider := QRCodeProvider;


LOCAL MoveToMagicPath(SourceFileName : Text) DestinationFileName : Text[1024]

Parameters:

Var Name DataType Subtype Length

No SourceFileName Text



Local Variables:

Name DataType Subtype Length

FileSystemObject Automation 'Windows Script Host Object Model'.FileSystemObject


DestinationFileName := ThreeTierMgt.ClientTempFileName(',');

IF ISCLEAR(FileSystemObject) THEN

  CREATE(FileSystemObject,TRUE,TRUE);

FileSystemObject.MoveFile(SourceFileName,DestinationFileName);


GenerateQRCode(InvDateTime : Text;TotalAmt : Text;VATAmt : Text;VAR TempBlob : Record TempBlob)

Parameters:

Var Name DataType Subtype Length

No InvDateTime Text

No TotalAmt Text

No VATAmt Text

Yes TempBlob Record TempBlob


Local Variables:

Name DataType Subtype Length

CompanyInfo Record Company Information

SalesInvoiceHeader Record Sales Invoice Header

QRCodeInput Text

QRCodeFileName Text


// Save a QR code image into a file in a temporary folder

CompanyInfo.GET;

CompanyInfo.TESTFIELD("VAT Registration No.");

QRCodeInput := CreateQRCodeInput(CompanyInfo.Name,CompanyInfo."VAT Registration No.",InvDateTime,TotalAmt,VATAmt);

QRCodeFileName := GetQRCode(QRCodeInput);

QRCodeFileName := MoveToMagicPath(QRCodeFileName); // To avoid confirmation dialogue on RTC


// Load the image from file into the BLOB field

CLEAR(TempBlob);

ThreeTierMgt.BLOBImport(TempBlob,QRCodeFileName);


// Erase the temporary file

IF NOT ISSERVICETIER THEN

  IF EXISTS(QRCodeFileName) THEN

    ERASE(QRCodeFileName);

In My case I am using Table 112 (Sales Invoice Header)  and one custom report to Generate and print the QR code in the report.

Expanded Data Type Data Source Name Include Caption

1 DataItem Sales Invoice Header <Sales Invoice Header> No

0 Column "Sales Invoice Header"."QR Code" QRCode_SalesInvoiceHeader No

0 Column "Sales Invoice Header"."Sell-to Customer No." SelltoCustomerNo_SalesInvoiceHeader No


Insert a Image in the report designer and Calcfield on TempBlob report


I have added a button on Posted Sales Invoice Page 132


Local Variables:

Name DataType Subtype Length

QRCodeMgmt Codeunit QR Code Mgmt.

TempBlob Record TempBlob


<Action1170000000> - OnAction()

CALCFIELDS("Amount Including VAT",Amount);

QRCodeMgmt.GenerateQRCode(FORMAT(CURRENTDATETIME),FORMAT("Amount Including VAT"),FORMAT("Amount Including VAT" - Amount),TempBlob);

"QR Code" := TempBlob.Blob;

MODIFY;

COMMIT;

REPORT.RUNMODAL(REPORT::"Print QR Code",TRUE,FALSE,Rec);


OutPut






Extension Unpublished/Uninstalled history required in BC Production environment

  There is a situation when someone can uninstall or unpublish any APP extension from the extension management in Production environment, th...