Posts

Showing posts from September, 2017

D365FO Use of FileUpload control to Read CSV file

Image
In Dynamics Ax implementation very often we get requirement to upload data using csv files. Although  in Dynamics 365 for operations it can be easily done using data entities and data packages, in this blog we will see how can we use new FileUpload control and design classes to read, download files. In   Dynamics 365 for operations  application runs on cloud and the client is in web , so Microsoft has introduce new process to read files using Azure blob. When we upload file, that file gets uploaded to Azure blob and we have to read that file from Azure blob to retrieve data. Design classes: There are two main types of classes that developers can work with for the file upload control: Upload strategy class  – This class lets developers control various parameters that should be enforced for uploaded files, such as the types of files that a user can upload and the maximum size of a file. It also lets developers determine where and how the uploaded file s

Read Files from Zip Folder in D365 using System.IO.Compression Namespace

Hi All , In this blog post we will see how to use System.IO.Compression Namespace to read files from Zip folder. The System.IO.Compression namespace contains classes that provide basic compression and decompression services for streams. I came across requirement where I had to read files from zip folder containing data for payroll and import it in Journals. Following piece of code will give you idea about how to use compression namespace to get count of the files with in folder , how to  extract file from zip folder and copy to stream object which can be used further for reading content of the file. void processZipFile() { #File FileUpload fileUploadControl = this.getFormControl(dialog, FileUploadName); FileUploadTemporaryStorageResult fileUploadResult = fileUploadControl.getFileUploadResult(); if (fileUploadResult != null && fileUploadResult.getUploadStatus()) { zipFileName = fileUploadResult.get

Generate Drill through link/Hyperlinks for SSRS report in D365

Here is new way to generate hyperlinks for SSRS reports in D365O For the action on the textbox: =Microsoft.Dynamics.Framework.Reports.BuiltInMethods.GenerateDrillThroughLink( Parameters!AX_ReportContext.Value, Parameters!AX_UserContext.Value, drill target menu item,  drill target menu item type,  table name,  field name,  [field name, field value]) drill target menu item The name of the menu item target for the hyperlink drill target menu item type The type of the menu item target for the hyperlink (e.g. “Display”) table name The name of the table referenced by the target menu item field name The name of the field in the table to restrict field value The value of the field in the table to restrict Optional Additional table name and field name pairs as needed Example: =Microsoft.Dynamics.Framework.Reports.BuiltInMethods.GenerateDrillThroughLink( Parameters!AX_ReportContext.Value, Parameters!AX_UserContext.Value, "MenuItemname", "Display", "CustInvoiceJour