Monday 31 December 2018

Import records from Excel using X++ code in D365FO

In this blog I will discuss how we can import records from Excel file in Dynamics 365 Finance and Operations.

Please see below screenshot with source code explanation:

Explanation of Source Code (1.1):
  • Add / Use following namespaces in the class. 


Explanation of Source Code (1.2):
  • Initialize and declare classes and data types.
  • Create a dialog object, which will open as form.
  • Add controls (Import, Upload and buttons).















Explanation of Source Code (1.3):
  • Get and load Excel file.
  • Get the row count for record iteration.
  • Iterate record and get the columns values on every iteration.















Result:
























That is all you need to do for creating a class which imports record from Excel.

3 comments:

  1. I am receiving this error 'Object reference not set to an instance of an object.'
    fileUploadResult = fileUploadControl.getFileUploadResult(); on this line

    ReplyDelete

Key Updates in Dynamics 365 F&O for Version 10.0.39

Here’s a concise summary of the  platform updates  in  Microsoft Dynamics 365 Finance & Operations version 10.0.39 (March 2024) : 1- Add...