Notifications
Announcements
No record found.
Hi guys,
I have a requirement to automate the process for importing the MT940 format bank account statement. I am able to import the MT940 file manually by selecting the file format and file. I have to do the process from x++ code and schedule a batch to run every day. I have one folder where all MT940 format file stores and I have to loop through each file and import bank statements.
I am using D365FO.
Please anyone can help me.
Hi Sandeep.Nathe,
Where is this folder? Have a look at this blog by me. I have used Power automate to read the file and import is using recurring integration.
Thanks Vinit,
I have checked your blog, You are using the Power automate app to get the file and import.
But in my case, We are accessing files using SFTP on a VM and I am fetching file from VM. I am actually looking for how to automatically select these files on VM and use it in the Import bank statement process through code(class). Later I will schedule this class to run every day.
Hi Sandeep,
Is there a particular requirement where you have to do via X++ code only? Power automate/ logic app has become normal in integrations. With the Power platform, things are more configure rather than code. it can easily be monitored. Send notifications/Emails for failed files etc. You can add as many different things you want and all by config. If you still want to use X++ code then you can use C# libraries to read files from SFTP. Look at community.dynamics.com/.../read-file-from-sftp, read the file content and call Recurring integrations from code via HTTP call (just mimicking what I did in Power automate)
Please remember that D365FO is a cloud service and it can't see any VMs or local folders. So you can't have a batch that imports files from a VM.
Instead you can use some external program that is installed in your company network (on some VM) and sends the files to D365FO.
But even easier if you use LogicApps to read the files from SFTP and send directly to D365FO. No need for any folders in between.
If you want to go with route of using x++ for connecting SFTP then you can use external libraries and which helps you to connect to SFTP then you have to store them in a blob storage and then pass it to your data project . Look at the class BankStatementImportBatch method doImportBankStatementsDMF which is responsible for importing bank statement MT940 , BAI2 in D365.
Below link will guide for a standard set up required on the data project.
docs.microsoft.com/.../set-up-advanced-bank-reconciliation-import-process
If you look at this class it does the same thing , upload files in blob gets the file Id , file name and use it later for processing those file using data project using doPGImport method. I have written a small blog on BAI2 import this will guide you to store file in blob once you get those from SFTP . You can easily automate these two task , getting file from SFTP and then passing those file
community.dynamics.com/.../msdyn365fo-bai2-import-uploading-files-to-blob-and-splitting-files-in-one-version
Using logic apps to connect to SFTP is another option where you don't have to write code to get the files and then pass those to your data project.
Thanks Vinit & Nicolaos,
Will try to implement the solution using LogicApps with SFTP.
Please can you provide any link if you have for LogicApps to read files from SFTP.
Thank you again.
Thanks Sukrut,
This is what I am looking for.
As you suggested I will check for Logic apps too.
You should be able to find documentation about Logic Apps and SFTP by searching the web for Logic Apps and SFTP.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 451 Most Valuable Professional
André Arnaud de Cal... 428 Super User 2025 Season 2
BillurSamdancioglu 239 Most Valuable Professional