HOWTO: Using WinAPI FindFirstFile, FindNextNext in Batch Jobs.

In batch job is not posible to call WinAPI functions WINAPI::FindFirstFile(..) and WINAPI::FindNextFile(…). This is limited only for code running on client. Sometimes is necesary have similar function for code running on server (or in batches). There is a code sample which is using .NET Framework. static void Job1(Args _args) { FilePath sFilePath; System.IO.DirectoryInfo di;…

1

Running direct SQL code using Connection class

Sometimes you need to use direct SQL code in your methods. The easiest way is to use Connection class. However you might run into the error “Request for the permission of type ‘SqlStatementExecutePermission’ failed.” This is because you’re using the class in client-side code. Connection class has to be used only in server-side code, so…


Calling external web services from AX

While calling external web service from AX you might experience following error: Object ‘CLRObject’ could not be created This is because web services must be called from code running on server. That why you need to set the class’s RunOn property to Server or to call the web service from a method marked as server…

1