Thursday, December 27, 2018

Multilanguage Translation in Dynamics 365 Business Central Extension

Multilingual translation/development made easy in AL

Please see this link Working with Translation Files in details (Source: Microsoft Docs).

Language translation has been facilitated with XLIFF file. XLIFF (XML Localization Interchange File Format) is an XML-based format created to standardize the way localizable data are passed between tools during a localization process and a common format for CAT tool exchange. See more about XLIFF.

Below are simple steps to this walk-through:


Step 1 : Add the below tag in app.json file
              
"features": [ "TranslationFile" ]




Step 2: Modify HelloWorld.al as below

Instead of direct message, route it through label.

pageextension 50100 CustomerListExt extends "Customer List"
{
var
Msg: label '[Business Central] App published: Hello world';

trigger OnOpenPage();
begin
Message(Msg);
end;
}

Step 3: Generate Translation file

Initiate the build command (Ctrl+Shift+B) in Visual Studio Code, it will generate a \Translations folder with the .xlf file that contains all the labels, label properties, and report labels that you are using in the extension. The generated .xlf file can now be translated.


For example my project has a global translation file based on ENU (English - United State).

Step 4: Copy, Paste, Rename & Update the language file

For this demo I have copy the "MyProjectD365BC.g.xlf" file & paste it in same folder, later renamed it as (as per naming convention suggested by Microsoft):


For example, I have copy & renamed the file as: "MyProjectD365BC.en-GB.xlf" for English - UK  & "MyProjectD365BC.zh-TW.xlf" for Chinese Traditional - Taiwan.

I have modified "MyProjectD365BC.zh-TW.xlf" file for target language as zh-TW & translation value. Use Bing Translate or Google Translate to get the Chinese Traditional value.



I have modified "MyProjectD365BC.en-GB.xlf" file for target language as en-GB & translation value. In case of en-GB, I have used Hindi to check the translation.


Save and compile/deploy your extension.

Step 5: Change user setting to see the translated value

Change the user setting for language code (from My Settings):


Select the Language "Chinese (Traditional, Taiwan) from list. Make sure Region must remain in English (United States).


Refresh or open the Customer list, now you can see the Hello World translation in Chinese.


See the changes with en-GB by changing My Setting --> Language to English (United Kingdom)


Refresh or open the Customer list, now you can see the Hello World translation in Hindi (as I have used Hindi translation in en-GB. Due to language characters are in Unicode and set in target caption/label translation, it is showing as it is - Hindi). You may try your own...



Keep exploring & sharing. AL for all...


Friday, November 16, 2018

Concept of Menusuites is not supported in Webclient (AL Language Extension)

Yes, this is true Menusuite is no longer available to control whether a page or report can be searchable in Web client.

So, we may have some question on our mind:
  • What is the alternate of Menusuite? 
  • How we will control Pages and Reports Searchable in Web client? 
  • What code we will write in AL language to make it happen?
And, answer is here: Microsoft has provided the way to handle it and make the Pages & Reports searchable through Web client.

Way 1: New property "UsageCategory" added to Page & Reports. By default this property is set to None when you create new Page or Report.

Below are list of UsageCategory value, that you can set and make the Page or Report searchable / see like appear in Department page like RTC client.
  • None
  • Lists
  • Task
  • ReportsAndAnalysis
  • Document
  • Administration
For example, we can write below code snippet in Page & Report development to make it searchable in Web client:

page 50110 MyVendorCard
{
PageType = Card;
SourceTable = Vendor;
UsageCategory = Documents;
ApplicationArea = All;
layout
{
area(content)
{
group(General)
{
field("No."; "No.") { }
field(Name; Name) { }
field(Address; Address) { }
}
}
}
}



Now, you may try and check with your own development...

Way 2: Another way, you can extent Navigation Pane page of existing role centre and/or adding actions to other existing pages.

Adding to the top level Navigation by extending RC:

pageextension 50111 MyPurchAgentRoleCenter extends "Purchasing Agent Role Center"
{
actions
{
addlast(Sections)
{
group("My Venodors")
{
action("Item Vendor Catalog")
{
RunObject = page "Item Vendor Catalog";
ApplicationArea = All;
}
}
}
}
}


Adding to the secondary level Navigation by extending RC:

...
addlast(Embedding)
{
action("Vendor Bank Account List")
{
RunObject = page "Vendor Bank Account List";
ApplicationArea = All;
}
}


Adding to Action by extending Page or RC:

addlast(Creation)
{
action("Vendor Item List")
{
RunObject = page "Vendor Item List";
ApplicationArea = All;
}
}


Source of above post: https://docs.microsoft.com/en-us/dynamics365/business-central/

Please explore above link to know in details.

Thursday, November 15, 2018

Connecting to Business Central On-premises through Mobile App

 Below are steps to connect Business Central On-premise through Mobile App.

We will connect mobile app with our on-premise Business Central hosted on local machine / network. Our mobile device must be in same network connected through WiFi or VPN or any.

I am demonstrating this scenario with my Laptop & Mobile connected through mobile Hotspot (both device sharing same network).

Step 1: Connect your laptop (which is already installed with Business Central) with you mobile Hotspot.




Step 2: Get your laptop IP address. (You may run command "ipconfig" or find it through your network properties.)




Step 3: Check you can access Business Central web client with local IP.




Step 4: Install Business Central App in you mobile device. Ignore this step if already installed.




Step 5: Open Business Central App in your mobile device:




Step 6: Click / tap on highlighted area (reason we are not going to connect it to hosted / Azure / Cloud)




Step 7: Enter or Paste Web Client URL in Service Name and tap to ->




Step 8: Enter credentials (Windows or what you have set in configuration). I am using Window User ID & Password.




Step 9: Tap next to connect and with till home screen appear.



Step 10: Bingo! Now explore app and enjoy BC



Please do share your feedback. It will encourage & help me a lot. Thanks! keep reading... more posts are on the way...




Wednesday, November 14, 2018

Reports in Extension using AL and Report Builder


How to create and design report in Business Central Extension using AL and Report Builder


Below are simple steps to create and design simple report in Business Central through AL & Report Builder. Even in C/AL we were designing reports layout in report builder. Same process has been provided with AL as well, where we will define data items & logic in AL code, later we will design layout in Report Builder. Finally, we will publish / build our report extension.


I will try to demonstrate below sample with AL & Report Builder together:





Step 1: Copy and Paste (Write) below code in AL (Visual Studio Code):


report 50101 "My Customer List"
{
    CaptionML = ENU = 'My Customer List';
    RDLCLayout = 'My Customer List.rdl';
    dataset
    {
        dataitem(Customer; Customer)
        {
            RequestFilterFields = "No.", "Search Name", "Customer Posting Group";
            column(CompnayName; COMPANYNAME)
            {
            }
            column(Customer_TABLECAPTION_CustFilter; TABLECAPTION + ': ' + CustFilter)
            {
            }
            column(CustomerNo; "No.")
            {
            }
            column(PostingGrou; "Customer Posting Group")
            {
            }
            column(Balance__LCY_; "Balance (LCY)")
            {
            }

            trigger OnAfterGetRecord();
            begin
                CalcFields("Balance (LCY)");
            end;

        }

    }
   
    requestpage
    {
        SaveValues = true;

        layout
        {
        }

        actions
        {
        }

    }

    labels
    {
    }

    trigger OnPreReport();
    var
        CaptionManagement: Codeunit 42;
    begin
        CustFilter := CaptionManagement.GetRecordFiltersWithCaptions(Customer);
    end;

    var
        CustFilter: Text;
}



Step 2: Save (Ctrl + S) and Build your extension (Ctrl + Shift + B) to generate “My Customer List.rdl”






Step 3: Open Report Builder 2016 and open “My Customer List.rdl” file from AL Project directory (for my case, I have saved my project in C:\Users\UserID\Documents\AL\ALProject2).


Find the report builder from app list:





Open “My Customer List.rdl” from project directory:




Design layout with published data sources & datasets:




Save and close the Report Builder.



Step 4: Attach report to page extension (initial Hello World J extension):


pageextension 50100 CustomerListExt extends "Customer List"
{
    actions
    {
        addlast(Navigation)
        {
            action("My Customer List")
            {
                ApplicationArea = All;
                RunObject = report "My Customer List";
                Image = "Report";
            }
        }
    }

    trigger OnOpenPage();
    begin
        Message('[Business Central] App published: Hello world');
    end;
}




Step 5: Build your extension & deploy (Shift + F5 / F5) to Business central. Check the page and run you report:






J Here you have done 1st report walk-through. Enjoy and keep extending Business Central using AL (Visual Studio Code)…

Monday, October 1, 2018

Application Management Codeunit Replacement

What does it mean: Application Management Codeunit Replacement

Yes, it's true. Application Management Coueunit 1 is no more exists in Dynamics 365 Business Central.

What's about the function? 
Are they exists? 
Where these are placed now? 
.
.
To many questions????

Don't worry, see this link - Codeunit 1 Replacement

Does this transition impact upgrade. Yes, see the solution as well in that link. 

How does these transition made? Where are those functions?

All available triggers / functions / events are now placed in System Codeunit and Management Codeunits.

See this link to get the details - Transitioning from Codeunit 1 to System Codeunits

Below are list of management codeunits where triggers / functions / events are moved now (except System Codeunits):

Type ID Name
Codeunit 40 LogInManagement
Codeunit 41 TextManagement
Codeunit 42 CaptionManagement
Codeunit 43 LanguageManagement
Codeunit 44 ReportManagement
Codeunit 45 AutoFormatManagement
Codeunit 49 GlobalTriggerManagement
Codeunit 50 SaaS Log In Management
Codeunit 79 Sales-Post and Send
Codeunit 2501 ExtensionMarketplaceMgmt
Codeunit 6710 ODataUtility
Codeunit 9015 Application System Constants
Codeunit 9170 Conf./Personalization Mgt.
Codeunit 9180 Generic Chart Mgt
Codeunit 9500 Debugger Management
Codeunit 9650 Edit MS Word Report Layout
Codeunit 9701 Cue Setup
Codeunit 9900 Data Upgrade Mgt.