web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 252

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.

I have the same question (0)
  • Suggested answer
    Sukrut Parab Profile Picture
    71,699 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,160 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
    252 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,160 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
    252 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,160 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

Responsible AI policies

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

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 756 User Group Leader

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 514 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans