Skip to main content

Posts

Addon Custom Headline in Standard Rolecenter Page in Business Central

Hi Buddies, In this blog we will see how we can add our custom Headline in Standard Rolecenter Page. In the below scenario i have add my custom Headline and when i click on this, it will root me to my website. Step-(1) Create a page extension, here i am modifying "Headline RC Business Manager" Rolecenter Page as shown below: pageextension 50021 "Headline RC BM Ext" extends "Headline RC Business Manager" {     layout     {         // Add changes to page layout here         addbefore( Control1 )         {             field( CustomHeadLine; CustomHeadLine )             {                 ApplicationArea = All;                 trigger OnDrillDown ()                 begin                     Hyperlink ( 'https://kunalhuria.blogspot.com/' ) ;                 end ;             }         }     }     var         CustomHeadLine: Label 'Welcome to <emphasize> Kunal Blog </emphasize>!!' ; } Here i have initialize Label value which i ha
Recent posts

Export to Excel in Microsoft Dynamics 365 Business Central

Hi folks, In this article we will see how we can export data using Excel Buffer table in Excel format. Here, i am using the Excel Buffer as a temporary table to store data from master table to Buffer table on temporary basis and then write it to Excel file. Step-(1) Based   on the data format and columns, create a new Procedure/function on Codeunit to export data and download it in excel file. Codeunit 50002 "Export to Excel" {     trigger OnRun ()     begin     end ;     procedure ExportSalesHeaderInfo ()     var         TempExcelBuffer: Record "Excel Buffer" temporary ;         RecSalesHeader: Record "Sales Header";         FullAddress: Text ;     begin         RecSalesHeader . Reset () ;         TempExcelBuffer . Reset () ;         TempExcelBuffer . DeleteAll () ;         TempExcelBuffer . NewRow () ;         TempExcelBuffer . AddColumn ( RecSalesHeader . FieldCaption ( "No." ) , false, '' , true, false, false, '' , TempE

Import Excel file using Excel Buffer in Business Central

Hi Readers,  In Last article we have seen how we can import data (.csv format) in Business Central. In this article we will see how we can  Import Data (Excel format - .xlsx)  in Microsoft Dynamics 365 Business Central. Here i am using Excel Buffer as a record variable to read data from Excel file for temporary basis and then will store it to Master/required table. Let us take a scenario to Import Excel file to Employee Table. Step-(1)  First analyze the format/ structure of the csv data file as shown below: Step-(2)  Secondly based on the data format and columns, create a new Procedure/function on Codeunit to choose and import file using the dialog box to read the data. Codeunit 50001 "Excel Buffer Import" {     trigger OnRun ()     begin     end ;     var         TempExcelBuffer: Record "Excel Buffer";     local procedure ReadExcelSheet ()     var         FileName: Text [ 100 ];         SheetName: Text [ 100 ];         UploadExcelMsg: Label 'Choose the

How to Use .Net/DotNet Variables in Business Central : OnPremise

Hi Guys, In this blog we will see how we can define .NET variables in Microsoft Dynamics 365 Business Central. NOTE:-   .NET Interoperability is only available on-premise. If you want to use this functionality, you must set the   "target": "OnPrem"   in the   app.json   file. For more information, see   JSON Files . Alternatively you can use services such as Azure Functions to call into .NET dlls from AL, which will also work online. For online training, see  Use Azure Functions with Dynamics 365 Business Central . By default, compiler only knows about the location of the mscorlib assembly. By following step we can define any compatible assembly by providing the compiler with a path to the assembly's containing folder: Step-(1) Open Visual Studio Code and then go to Settings and search for Assembly Probing Paths to define referenced .NET assemblies: "al.assemblyProbingPaths": [     "./.netpackages",     "c:/Windows/assembly/",  

Import CSV file using CSV Buffer in Business Central

Hi Everyone,  In this article we will see how we can Import Data (CSV/Excel format) in Microsoft Dynamics 365 Business Central. Here i am using CSV Buffer as a record variable to read data from csv file for temporary basis and then will store it to Master table. Let us take a scenario to import CSV file to Employee Table. Step-(1) First analyze the format/ structure of the csv data file as shown below: Step-(2) Secondly based on the data format and columns, create a new Procedure/function on Codeunit to choose and import file using the dialog box to read the data. codeunit 50001 "CSV Import" {     trigger OnRun ()     begin     end ;     procedure ImportEmployeeDetailViaCSVBuffer ()     var         csv_InStream: InStream ;         uploadResult: Boolean ;         csvFileName: Text ;         csvBuffer: Record "CSV Buffer";         RecEmployee: Record Employee;     begin         if UploadIntoStream ( 'Import Employee CSV' , '' , '' , c

Run Customize Report in Place of Standard Report in Businss Central : Report Management

Hi Everyone, In this article we will see how we can run Customized report in place of standard Report using Report Management Codeunit. As we all know that sometimes we get the basic requirements from Client to do some minor changes in Standard Report. Accordingly, will see how we can do changes in standard report or Create custom report and then Run the custom report in place of standard Report. Step-(1) First we have to configure the new Report to replace it with Standard Report: As in this case i have already Customized Purchase Order (Report ID - 50100)  Report as show below: Step-(2) Now create a procedure & subscribe it to the OnAfterSubstituteReport   event , i.e, basically it will just replace the report specified by the ReportId with the newly created report as NewReportID parameter: codeunit 50100 "Substitute Report" {     [EventSubscriber (ObjectType :: Codeunit , Codeunit ::ReportManagement, 'OnAfterSubstituteReport' , '' , true, true ) ]

Integration in Business Central & Read JSON Data and store in Table : Using Http

Hi Readers, In this article will see how we can create connection with external application using  HTTP and read the Json data & store it in business central. In this scenario, if i will enter the ID then it will fill all the related details by getting information from third party application. Step-(1) Firstly i have created the table and call the procedure on OnValidate trigger. table 50102 "User Details API" {     DataClassification = ToBeClassified;     fields     {         field( 1 ; ID; Integer)         {             DataClassification = ToBeClassified;             trigger OnValidate ()             var                 JsonReadAndWrite_CU: Codeunit "Json Write";             begin                 JsonReadAndWrite_CU . JsonReadAndWrite ( Rec ) ;             end ;         }         field( 2 ; Name; Text [ 50 ] )         {             DataClassification = ToBeClassified;         }         field( 3 ; "User Name"; Text [ 50 ] )         {