Announcements
No record found.
You'll remove this warnin by following what it told you - stop using WinAPI class.
If you want to also know how to redesign your code, you'll need to tell us what your code is supposed to do.
Thank You Martin for your quick response !
As "WinAPI" is for Ax2012, now I am using D365 finance and operation. When i search for alternate of this method in D365 finance and operation. what I found is
"Migration notes
Remove usage of these APIs from your code. Replace file access APIs, such as WinAPI::getTempPath, WinAPI::fileExists,
with the new file APIs."
Is there any alternate class of "WinAPI" in D365 finance and operation ?
As I said, it all depends on what you're trying to achieve with your code.
If you're trying to access files on users' machines, forget it - it's not possible. The web server running somewhere in Azure can't read files on machines that merely send HTTP requests to it.
If you want to read files on AOS, it also doesn't make good sense either. You could use an Azure storage instead, which will be shared by all AOS instances.
There is really no way to design a solution without first understanding what it should do.
Ok, I understand what you want to say !
I think its just checking weather the file exist or not.
Actually I am removing the Best practice issues of already existing projects and also the project is migrated from AX2012 to D365 FO.
As Microsoft describe
My question is "Is there any alter class of WinAPI for D365 FO ?"
That's a wrong question. You shouldn't try to alter WinAPI class. What you should do is rethinging the solution to work in F&O. This is not just about removing best practice violations.
In most cases, you shouldn't work with the file system at all, therefore you need to change the whole architecture, not just replacing a single method call.
If you have no idea what the code is doing, you aren't in a position to upgrade it. Your next step must be learning what the code is for.
The code above is deleting a file and checking if the file exists before trying to do it. Ask yourself what file it is. Which process it is related to? On which computer do you expect it exist? Does it really makes sense in F&O?
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 664
André Arnaud de Cal... 615 Super User 2026 Season 1
CP04-islander 550