Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Write and save a excel file to a local folder in D365FO

(0) ShareShare
ReportReport
Posted on by 242

Hi,

I am trying to create and save a excel/csv file to a path through code in D365. As of now, the code lets the user to download or save the file manually once after the execution. Is there any possibility to download or save the file automatically through the code. I am trying to use File and DocuFileSave classes.

Thanks,

Suren.

  • Suggested answer
    Sukrut Parab Profile Picture
    71,682 Moderator on at
    RE: Write and save a excel file to a local folder in D365FO

    I agree with Nikolaos , no need to develop anything using x++ in such a scenario.  power automate , logic apps  helps you in such a scenarios. Take a look at using data package API , one such a example  you can look in below blog post.

    msdynamicsworld.com/.../how-use-power-automate-extract-data-microsoft-dynamics-365-finance-and-operations-data

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Write and save a excel file to a local folder in D365FO

    My first suggestion is to not develop anything, instead use something that others have already developed such as LogicApps. This is most likely cheaper since somebody already figured out all that is needed in the integration.

    If you really want to invest in developing it yourself, you can search first for "d365fo x++ OneDrive". If you can't find anything, then google "c# OneDrive integration", and develop a C# library which you then use from x++ code. It's really nice to be able to benefit of all C# articles, libraries etc in D365FO.

  • Suren_G Profile Picture
    242 on at
    RE: Write and save a excel file to a local folder in D365FO

    Hi Nikolaos,

    Thanks for your response. I am not getting any blog to handle the onedrive save through code. Could you please let me know if there is any blog or code handling the same?

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Write and save a excel file to a local folder in D365FO

    Yes, there is a way to save it to one-drive through code. OneDrive is accessible from public internet, unlike your local folders.

  • Suren_G Profile Picture
    242 on at
    RE: Write and save a excel file to a local folder in D365FO

    Hi Blue Wang,

    I have gone through the link that you have shared. Is saving the excel to One-drive is manual? Or is there any way to save it to one-drive through code?

    Thanks,

    Suren.

  • Blue Wang Profile Picture
    on at
    RE: Write and save a excel file to a local folder in D365FO

    Hi Suren,

    Go through this.

    About Recurring integration scheduler, please refer this:

    github.com/.../Recurring-Integrations-Scheduler

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Write and save a excel file to a local folder in D365FO

    Moved to D365 Finance forum.

    If you use D365 FO in cloud, there's no way how the system would be able to start writing files to your local folders. That would be a huge security issue if websites could access your computer by themselves.

    But you can use an integration platform such as BizTalk, LogicApps or Recurring Integrations Scheduler (free sample app from Microsoft) to poll D365FO, fetch files and save them on local folder. This integration platform or part of it would be hosted locally on your company network on some server and that's how they would be able to access your local folders.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,311 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,183 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans