Posts

Showing posts with the label Exporting and Import

Create an excel file and send it through Email in D365 using X++ code

Image
             This post is about creating an excel file using X++ and attach it as an Email(office 365 SMTP) attachment without saving it in local file location.  SysMailerMessageBuilder          mailer  = new SysMailerMessageBuilder (); SysMailerSMTP                    smtp    = new SysMailerSMTP (); RowNumber                        row     = 1 ; RESPDCLogTable                   pDCLogTable1; System.IO. MemoryStream  memoryStream     = new  System.IO. MemoryStream (); mailer.setSubject(strFmt( "PDC posted batch status %1" ,sessionDate)); mailer.setFrom( Sys...

Create movement journal through X++ code in D365FO(Import code)

class DAL_MovementJournal {       public static void main( Args _args)     {

Importing data from Excel through X++ code

  Sometimes we need to import data from  Excel to  Microsoft Dynamics 365 form  using x++ code. Through this post can see how to import a data from  excel to  form Public static class ImportLeaveRequestLine {     public static void main( Args _args)     {         System.IO. Stream stream;         LeaveRequestHeader LeaveRequestHeader = _args.record();         LeaveRequestLine    LeaveRequestLine;         ExcelSpreadsheetName sheeet;         FileUploadBuild fileUpload;         DialogGroup dlgUploadGroup;         FileUploadBuild fileUploadBuild;         FormBuildControl formBuildControl;  ...

Exporting data to Excel through X++ code

             Sometimes we need to export data from Microsoft Dynamics 365 to Excel using x++ code. Through this post can see how to export data from form to excel class SMJ_ExportData {     public static void main( Args args)     {         PurchParmLine   PurchParmLine,PurchParmLineSelect;         PurchParmLine = args.record();         DocuFileSaveResult saveResult = DocuFileSave ::promptForSaveLocation( "@ApplicationPlatform:Testingexcelexport ", "xlsx" , null , "Testing excel export" );         if (saveResult && saveResult.parmAction() != DocuFileSaveAction ::Cancel)         {             saveResult.parmOpenParameters( 'web=1' );   ...