Hi everyone,
I am trying to save notepad file via batch process in AX 2012. I am getting "invalid attempt to cal winapi.fileexists runnning in CIL on client" error when the batch process executes. I got the error that batch doesnt support client specific process. But may i know the solution to resolve this issue.
Thanks & Regards
Arpit Chavhan
*This post is locked for comments
Arpit,
The WinApi class is for processes running on clients. Consider adding a test in your code to detect if the current context is running server side and if so use WinApiServer, or better yet rewrite your code to use .Net completely to check for existence of files.
Here are some examples of file handling using .Net
colinmitchell.net/.../file-handling
Best of luck!
Hi,
I mean setting up a network share that is both accessible by clients and AOS. When setting up the batch job, set the file destination to the network share. Then, use WinAPIServer instead of WinAPI in the code for fileExist check (because WinAPI is set to RunOn client).
P.S. Or maybe I read your questions incorrectly, all you need is WinAPIServer =)
Regards,
Dominic
Hi Dolee,
Can you please elaborate. I didnt get it actually.
Is using a network share a possible?
Regards,
Dominic
Mohamed Amine Mahmoudi
100
Super User 2025 Season 1
Community Member
48
Zain Mehmood
6
Moderator