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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

invalid attempt to cal winapi.fileexists runnning in CIL on client

(0) ShareShare
ReportReport
Posted on by 4,359

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

I have the same question (0)
  • dolee Profile Picture
    11,279 on at

    Is using a network share a possible?

    Regards,

    Dominic

  • ARPIT CHAVHAN Profile Picture
    4,359 on at

    Hi Dolee,

    Can you please elaborate. I didnt get it actually.

  • dolee Profile Picture
    11,279 on at

    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

  • Suggested answer
    Tommy Skaue Profile Picture
    Microsoft Employee on at

    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!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans