Skip to main content

Posts

Showing posts from January, 2022

How to Create & Download the Json in Business Central : Using Json Datatypes

Hi Experts, In this article i am learning & sharing with you guys that how to Create Json structure in Business Central. In this example, i am creating Json structure from Customer table and store that Json file in local system. Codeunit 50101 "Json Write" {     trigger OnRun ()     var         Customer_Rec: Record Customer;         JObject_Cust: JsonObject ;         JObject_Address: JsonObject ;         JArray_Address: JsonArray ;         JObject_PostingGroup: JsonObject ;         JArray_PostingGroup: JsonArray ;         RecTempBlob: Record TempBlob;         InStr: InStream ;         OutStr: OutStream ;         FileName: Text ;         Result: Text ;     begin         // Code to Create Json file Structure_Start         Customer_Rec . get ( '10000' ) ;         JObject_Cust .Add( 'No.' , Customer_Rec . "No." ) ;         JObject_Cust .Add( 'Name' , Customer_Rec . Name ) ;         JObject_Address .Add( 'Address' , Customer_Rec .