Wednesday 4 July 2018

Import/ Upload data in D365/AX7 using excel file

This blog is about how to upload data in D365 using excel file. As we all know that AX7 is running on web browser so importing data using excel has been changed. For instance like filename, fileNameOpen extended data types are no more supported. Likewise following classes: SysExcelApplication ; SysExcelWorkbooks ; SysExcelWorkbook ; SysExcelWorksheets ; SysExcelWorksheet ; SysExcelCells  does not exist in D365 anymore.
Here I will be discussing about how to upload vendor basic information using import utility. The source of file will be excel and will contain data of basic fields which are required for vendor master creation.

1. Create a new project and add a new item form (VendorUploadUtility) in it.













2. Set pattern of form as Dialog-Basic.  Add a custom group and which will contain a file upload control inside it.







3. Setting following properties on fileUpload1 control.














4. Now add a button group and add two button in it (OK and Cancel command button)










5. Create a display menu item namely “ VendorUploadUtility” and assign newly created form to it.











6. Create a new class namely ‘ImportVendorMasterData’ and add below code.
















7. Create a new action menu item namely “UploadVendorMaster” and attach previous class with it as its object.













8. Override clicked method of OK command button and onUploadCompleted method of fileUploadControl1 of previously created form VendorUploadUtility and add below mentioned code in it.
























9. Create extension of accounts payable menu namely “AccountsPayable.Extension” and add menu item reference in periodic task section namely “UploadVendors” and attach display menu item “VendorUploadUtility” with it.













10. Build complete project

11. For uploading data – excel file  template.







12. Go on this navigation: AccountsPayable -> Periodic tasks -> Upload vendors



























13. Before uploading data you need to run Microsoft Azure Storage Emulator . For this go on windows and search “Microsoft Azure Storage Emulator v4.0” and click on it. Auto command prompt will be open and required processing will be done.






















14. Upload file by clicking on browse button and then click on upload button. When file will be uploaded successfully then click on ok button in bottom to start processing.
After uploading file progress bar will be shown as below.















Vendors will be created and message will be prompted.










Final output: 3 vendors will be created. Verify on this navigation: Accounts Payable -> Vendor -> All Vendors









Note : Do not confuse with count we have given 3 vendors in input file prompt is showing 4 because it is considering header row too in counter.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Connect and upload in azure blob with azure key vault using x++

 Today, I will be sharing details about file upload in azure blob using azure vault that includes pre requisite and code snippet used to it....