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

Notifications

Announcements

No record found.

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
    Moderator 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans