Bojensen Blogs

Måned: juli 2013

An alternative to the WinApi functions

  The WinApi class holds some nice functions for file manipulation, like the WinApi::fileExistsWinApi::copyFileWinApi::deleteFileWinApi::moveFile I think every programmer has used one of those functions in Ax at one time or another, as they can be really helpful. They have one big drawback though: They need to be executed on the client tier. Trying to use…

Stack trace: Invalid attempt to call WinAPI::findFirstFile running in CIL on the client.

This error you will normally encounter when running a batch job. The issue is that batch processing doesn’t suppport WINAPI::findFirstFile method. Actually I was trying to find a file in the folder and moving to some other folder, you can use this alternative: public void run(){    System.IO.DirectoryInfo di;    System.Type arrayType;    System.Array array;    System.IO.FileInfo fi;    FilePath…