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)

Write to .csv file in Dynamics 365 for Operation

(0) ShareShare
ReportReport
Posted on by 185

Hi All,

I am trying to write to .csv file through some custom code in Dynamics 365 for Operations. Will I be able to use CommaTextIo or CommaIo here in Dynamics 365 in the same way like we did in AX 2012? I tried using the same code, but I am getting exceptions. Need some insight on this.

Kind regards

Manjunath Ingalagi

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    community.dynamics.com/.../how-to-work-with-files-in-ax-7-part-1-upload-download-read-and-store-files-in-db

    https://ax.help.dynamics.com/en/wiki/c-classes/#class-commatextio

    CommaIO has been replaced by CommaTextIO as per the documentation, see the wiki link above.

    You are welcome. Please use search next time yourself.

  • André Arnaud de Calavon Profile Picture
    301,146 Super User 2025 Season 2 on at

    Hi Manjunath,

    Vilmos suggested some good reading for you. I would like to mention that it would be easier to get valuable answers if you add the error details if you get exceptions.

    Also don't use hashtags in the tags. You have to separate keywords with a comma. I have corrected it this time for you.

  • Manjunath Ingalagi Profile Picture
    185 on at

    Hi Vilmos & Andre,

    @Andre - Would keep that in mind next time not to add hashtags. Thanks!

    @Vilmos - Thank you for article links. I will surely go through them. I used the same code as mentioned in the 2nd link. I also went through to check if I can make use of "FileUploadTemporaryStorageResult & AsciiStreamIo".

    For CommaTextIo this is the code that I was trying to run.

    4135.Exception.png

    Kind regards,

    Manjunath Ingalagi

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Your code seems to refer to a local file, which will obviously not work, since the code runs server-side on the AOS.

    You could also put a try-catch block around, get the exception, and see the inner exception to get more details on what the error is.

  • Manjunath Ingalagi Profile Picture
    185 on at

    Yes. I am not able to read the file. I'll put a try catch block and see if I can fix based on the exception. But then again, can we tweak this code itself or we have to make use of any new classes like FileUploadTemporaryStorageResult & AsciiStreamIo?

    Kind regards,

    Manjunath Ingalagi

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Read the first blog post on how can you handle files. It must be uploaded from the local computer using the example there, you cannot directly read it, which is what you are currently attempting. AX is looking for that file on the AOS instances' C:\ drive...

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans