FileImport – Bojensen Blogs
Bojensen Blogs

Tag: FileImport

Dynamics AX: Read All Files inside a directory

 void FindAllCSV() { #Evat_NL #File Filename baseFolder; Filename csvFilename; Filename foundBaseFileName; Filename foundFileName; container mainFolder, subFolder, fileContainer; boolean filesFoundMainFolder = true; boolean filesFoundSubFolder = true; int apiResult; int setCurrentFolder (Filename _filename = ”) { ; return WinAPI::setCurrentDirectory(_filename); } ; baseFolder = “C:TEST”; apiResult = setCurrentFolder(SysTreeNode::duplicatePathDelimiters(baseFolder)); mainFolder = WinAPI::findFirstFile(“*.*”); foundBaseFileName = conpeek(mainFolder, 2); while (filesFoundMainFolder) {…

How to import multiple file from a folder? – Microsoft Dynamics AX

container createListOfFiles(FilePath _path = path, FileNameType _pattern = pattern) {     System.Array    files;     int             fileCount;     int             i;     str             nextFile;     new InteropPermission(InteropKind::ClrInterop).assert();     info(strfmt(‘Search in: %1 %2’, _path, _pattern));     listOfFiles     = connull();     actIx           = 0;     files           = System.IO.Directory::GetFiles(_path, _pattern);     if (files)     {         fileCount =    files.get_Length();         info(strFmt(‘Number of…