Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

How to replace the file or file stream for the uploaded files using the url in D365FO using x++?

(0) ShareShare
ReportReport
Posted on by 214
Hi All,

We have a requirement, where user will upload unadjusted bank statement (.TXT) and as a part of our customization, there are few modifications required in the file to make the file adjusted once it is uploaded by the user.

The custom code to make the file adjusted is already developed but somehow, I am not able to replace the uploaded file data with new data as I will have to replace file or file content during one process so that the system will consider adjusted file but NOT the one that user has uploaded.

So, Is there any way where we can replace the uploaded file with the new file or uploaded file steam with new steam so that the adjusted file will be considered for further process?
 
I want to replace the file or file stream that getDownloadUrl() method returns.
 
Standard class name: BankStatementImportBatch
 
Any suggestions...
  • Martin Dráb Profile Picture
    Martin Dráb 230,540 Most Valuable Professional on at
    How to replace the file or file stream for the uploaded files using the url in D365FO using x++?
    I don't, because I even don't know what you'd like to do there.
  • Dhruv R Thakar Profile Picture
    Dhruv R Thakar 214 on at
    How to replace the file or file stream for the uploaded files using the url in D365FO using x++?
    Hi Martin, do you have any sample code to manipulate the uploaded file?
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,540 Most Valuable Professional on at
    How to replace the file or file stream for the uploaded files using the url in D365FO using x++?
    If you want to modify the files already on upload (not inside BankStatementImportBatch.run()), then extending BankStatementFileTemporaryStorageStrategy class may be the best approach.
     
    For example, you could manipulate the stream already at the beginning of uploadFile().

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,861 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,540 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans