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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Permission to read file in batch job

(0) ShareShare
ReportReport
Posted on by 183

Hi guys,

I'm trying to read the CSV files in network folder, using batch job, but I'm getting the error below. Is working when I do not check the batch processing. I checked the network folder permission and all users have full access (non production environment). Could you help me?

PS: It is in AX 4.0...

pastedimage1609185105683v1.png

pastedimage1609186414156v2.png

I have the same question (0)
  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Rafael,

    Please check this post. You can add this code to the import logic.

    InteropPermission permission = new InteropPermission(InteropKind::ClrInterop);
    ;
    permission.assert();

  • Suggested answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Gunjan is right - the error message is about InteropPermission, not file permissions.

    Use CodeAccessPermission::assertMultiple() to assert multiple permissions at once.

  • Rafael Araujo Profile Picture
    183 on at

    Hi Gunjan and Martin,

    I added the InteropPermission, but the issue is in the line below:

    commaIo = new CommaIo(fileName, #io_read);

    When I run without batch processing is working, but when I run with batch processing the commaIo is null.

    pastedimage1609237703103v1.png

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    You mentioned that users have access, but does the AOS service account permissions to read the file?

  • Rafa Araujo Profile Picture
    30 on at

    I changed the AOS service account to my own user. I have access in the path, in the file... but using batch processing show the same issue.

    pastedimage1609256725983v1.png

    pastedimage1609256766153v2.png

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Did you rebuilt CIL?

    Does it work if you execute the code in CIL but not in batch?

  • Rafa Araujo Profile Picture
    30 on at

    Full CIL in AX 4.0? Is the first time that I use the AX 4.0... I didn't find the Full CIL option.

    Without batch processing is working. The issue is only with batch processing.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Did you make sure that the AOS service account has access to the shared location you are reading the file from?  It's might be running fine for you as your account has the required access.

  • Rafa Araujo Profile Picture
    30 on at

    Yes, I'm sure. I created a new folder in the server and shared with permission to all users, I can create, edit, delete and change the files. Just in batch job do not work.

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Sorry, I forgot it's about AX 4.0.

    The case when it works, does it run on the server tier?

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans