web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Dynamics 365 how to import CSV and Excel file using visual studio?

(0) ShareShare
ReportReport
Posted on by

Dear 

In AX 2012 we used to use following code to import a CSV file using the TextIO.read() method and then use the conpeek(container, column number) to access the column of the CSV file

4251.Import3.png

apparently this code has been depreciated in Dynamics AX 365 , what can we use instead of those in order to migrate data from CSV files in Visual Studio

appreciate your feedback ,

regards

    Dialog      dialog  = new Dialog();
    DialogField dialogFileName;
    DialogField dialogField;
 
    FileIOPermission permission;
    Filename filename;
    TextIO textIO;
 
    str filePath,fileNameOnly;
 
    filetype type;
 
    container record;
    Container filterCriteria;
 

    str         Delimiter = ",";

*This post is locked for comments

  • Suggested answer
    Martin Dráb Profile Picture
    on at
    RE: Dynamics 365 how to import CSV and Excel file using visual studio?

    For CSV, I would use TextStreamIO::constructForRead().

    If you must deal with Excel spreadsheets as well (although it's not in the code above), consider OpenXML, which is already included in the platform (AOT reference DocumentFormat.OpenXml).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans