Category: Business Central Wave 2

How to Substitute Report in Business Central

Today we will see how we can substitute our own document report with Standard report in business central.

To override report we need to use ReportManaagement Codeunit and from that we need to use OnAfterSubstituteReport event

Suppose we have created own customize report called ‘Detail Inventory Transaction’ and now we have to replace standard report for Inventory Transaction Detail

[EventSubscriber(ObjectType::Codeunit, 44, 'OnAfterSubstituteReport', '', true, true)]
    procedure SubstituteInventoryTransactionReport(ReportId: Integer; var NewReportId: Integer)
    begin
        If ReportId = Report::"Inventory - Transaction Detail" then
            NewReportId := Report::"Detail Inventory Transaction";
    end;

Publish your extension and check the report .You will find new report is substituted with standard report.

Hope this will help you.

Stay tuned for more..

How to Prepare Opening balance template in Business Central

One of nice feature of business central for opening balance.

This will help one to have readymade template of opening balance with ledger account where in one can key in amount and post or even export in excel and after key in values import back to Business Central and post

Hope this small link will help to prepare opening balance as this gives template with ledger account.

Stay tuned for more..

Cumulative Update Summary January 2020

Cumulative Update includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV.

Microsoft Business Central Wave 2:- BUSINESS CENTRAL Wave 2

Microsoft Dynamics NAV 2018 CU 25 :- NAV2018CU25

Microsoft Dynamics NAV 2017 CU 38 :- NAV 2017 CU38

Microsoft Dynamics NAV 2016 CU 51 :- NAV 2016 CU51

Microsoft Dynamics NAV 2015 CU 63 :-NAV 2015 CU 63

Warning

Before you install a cumulative update in a production environment, take the following precautions:

  1. Test the cumulative update in a non-production environment.
  2. Make a backup of the system or computer where the cumulative update is to be installed.

Stay tuned for more updates…

Cumulative Update Summary December 2019

This image has an empty alt attribute; its file name is updateimage.jpg

Cumulative Update includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV.

Microsoft Business Central Wave 2:- BUSINESS CENTRAL Wave 2

Microsoft Dynamics NAV 2018 CU 24 :- NAV2018CU24

Microsoft Dynamics NAV 2017 CU 37 :- NAV 2017 CU37

Microsoft Dynamics NAV 2016 CU 50 :- NAV 2016 CU 50

Microsoft Dynamics NAV 2015 CU 62 :-NAV 2015 CU 62

Warning

Before you install a cumulative update in a production environment, take the following precautions:

  1. Test the cumulative update in a non-production environment.
  2. Make a backup of the system or computer where the cumulative update is to be installed.

Stay tuned for more updates…

How to Create Assisted Setup -Business Central

As you aware that with new version of business central comes up breaking changes which actually change the way of writing few points like assisted setup and many more.

Today we will see how to create assisted setup in wave 2 with new events. In this document have created one of the most simple assisted setup.

Step 1 :- Create New table

table 50100 "SetupTable"
{
    DataClassification = CustomerContent;

    fields
    {
        field(1; GroupCode; Code[10])
        {
            DataClassification = CustomerContent;

        }
        Field(2; "Group Description"; text[100])
        {
            DataClassification = CustomerContent;
        }
    }

    keys
    {
        key(PK1; GroupCode)
        {
            Clustered = true;
        }
    }



}

2. Create New page

page 50100 "SetupPage"
{
    PageType = ListPart;
    SourceTable = SetupTable;
    layout
    {
        area(content)
        {
            repeater(SetupGroup)
            {
                field(GroupCode; GroupCode)
                {
                    ApplicationArea = All;
                    ToolTip = 'Select the specified group code';
                }
                field("Group Description"; "Group Description")
                {
                    ApplicationArea = All;
                    ToolTip = 'Specifies a description.';
                }
            }
        }
    }
}

Step 3 :- Now use new assisted setup module to create assisted setup as below

codeunit 50100 "SetupTableAssistedSetup"
{

    var
        AssistedSetup: Codeunit "Assisted Setup";
        AssistedSetupGroup: Enum "Assisted Setup Group";
        CurrentGlobalLanguage: Integer;
        SetupWizardTxt: Label 'Set up Table';
        SetupWizardLinkTxt: Label 'https://google.com', Locked = true;

        AlreadySetUpQst: Label 'Setup is already set up. To change settings for it, go to the setup again.Do you want go there now ?';

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Assisted Setup", 'OnRegister', '', false, false)]
    local procedure SetupInitialize()

    begin
        CurrentGlobalLanguage := GlobalLanguage();
        AssistedSetup.Add(GetAppId(), PAGE::SetupPage, SetupWizardTxt, AssistedSetupGroup::Extensions, '', SetupWizardLinkTxt);
        GLOBALLANGUAGE(1033);
        AssistedSetup.AddTranslation(GetAppId(), PAGE::SetupPage, 1033, SetupWizardTxt);
        GLOBALLANGUAGE(CurrentGlobalLanguage);
        GetInformationSetupStatus();
    end;

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Assisted Setup", 'OnReRunOfCompletedSetup', '', false, false)]
    local procedure OnReRunOfCompletedSetup(ExtensionId: Guid; PageID: Integer; var Handled: Boolean)
    begin
        if ExtensionId <> GetAppId() then
            exit;
        case PageID of
            Page::"Assisted Company Setup Wizard":
                begin
                    if Confirm(AlreadySetUpQst, true) then
                        Page.Run(PAGE::SetupPage);
                    Handled := true;
                end;
        end;
    end;

    local procedure GetAppId(): Guid
    var
        Info: ModuleInfo;
        EmptyGuid: Guid;
    begin
        if Info.Id() = EmptyGuid then
            NavApp.GetCurrentModuleInfo(Info);
        exit(Info.Id());
    end;


    local procedure GetInformationSetupStatus()
    var
        SetupTab: Record SetupTable;
    begin
        SetupTab.SetFilter(GroupCode, '<>%1', '');
        If SetupTab.IsEmpty() then
            exit;
        AssistedSetup.Complete(GetAppId(), Page::SetupPage);

    end;
}




Publish the extension and you will see following result.

Hope this will help you….

Business Central :How to Customize Base App

This blog explains how to customize the base app of business central (old fashion) .

Please Don’t customize the base app, Use extension wherever possible

Step 1 :- Copy Base Application from installer

Step 2 :- Unzip in designated folder .This contains app.json file where in target set to onprem

app.json will look like this

Step 3 :- Download the symbols

Step 4:- Add the following in either user settings/workspace settings . This is required for .NET DLL used in application

Step 5 :- Unpublish the base application and dependencies or else you will get an error stating that extension already deployed on tenant

Use following PowerShell command

Unpublish-NavApp -Name “Base Application” -ServerInstance BC150

Step 6:- Import license file and publish the modified app.

Hope this will help you.

Keyboard Shortcut :- Business Central & VS Code

For my previous contribution on business central please visit this link

This blog contains keyboard shortcut for business central and VS code while will make our life easier while navigating and developing business central extension aka app.

Hope this will help you…

Business Central : Deprecated and Obsolete Fields

With the new version of business central wave 2 ,number of fields have been deprecated or obsolete

1) Fields moved to an extension by Microsoft

2) Fields marked as Obsolete:Pending

3) Fields no longer in use in Microsoft code

Impact of this is to refactor your solution as soon as possible

For more information of which field get deprecated visit this link Deprecated Fields

Hope this will help you…

How to Set Company Badge in Business Central

For earlier blog post on business central you can follow the  Link

This blog post explains how to set company badge in business central wave 2 . With this new feature one can add a customized badge in the top right corner from which we can identified company name.

Only four characters are allowed for key in and display.

If a company badge is defined, then you cannot change the company name

Hope this will help you and keep exploring.