AX 2012: File existance check

AX 2012: File existance check

MCP · Azure DevOpsYour delivery board, readable by an agentMCP · DataverseOne consent, and the data layer opensMCP · Dynamics 365 F&OConnecting F&O to an agent Microsoft hasn’t documented
Multiple ways to check file existance in AX 2012;

Client side check, does not work with batch job

WinAPI::fileExists(_fileName);

Server side check which works for run base batch too

public boolean getFileExists(filepath _fileName)
{
   System.IO.FileInfo   fileInfo;
   new InteropPermission(InteropKind::ClrInterop).assert();
   fileInfo = new System.IO.FileInfo(_fileName);
   return fileInfo.get_Exists();

}
Previous article← AX 2012 - How to retrieve meeting (appointment) status from Outlook
Discussion

Ask a question or leave feedback

This is a review interaction. The WordPress version will store, thread and moderate comments.

Thanks — submitted for moderation in this review.
Search the whole site · Ctrl/⌘ + K