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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to save text / csv file from D365?

(0) ShareShare
ReportReport
Posted on by 6,480

Hello,

I have to export / save some field values during the posting of invoice.

I could not find guidance how is it possible to write data into file, which will be later saved / downloaded from system.

Could you please help me to go with correct direction? Which classes to use? How the files can be saved?

Thanks.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Shahil Profile Picture
    635 on at

    Hi 

    I've written a simple job that allows you to write data to a file and downloads it.

    https://dynamics365foroperation.blogspot.com/2018/02/create-csv-file-and-save-it.html

    You might find this helpful

    In your case, once the posting is done, you can simply create a new method that writes whatever data you want to a stream. Some of the classes you could use to write/read files is CommaStreamIo, CommaTextStreamIo, TextStreamIo. 

    For saving the file, either you can save it into a temporary blob storage and download it later or you can redirect user to a browser window to download. Have a look at FileUploadTemporaryStorageStrategy, FileUploadTemporaryStorageResult, FileUpload, FileUpload or the File class. 

    Find references on these and you'll find a lot of useful examples on how these are being used. 

  • pralay_kumar_das Profile Picture
    260 on at

    Dear,

    dynamics365foroperation.blogspot.com/.../create-csv-file-and-save-it.html will guide you writing code to export data.

    By Chrome settings You can set it auto download where it will not prompt you to click the download icon and will be downloaded in default location. for this go to chrome settings and look download tab.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans