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
Client side check, does not work with batch job
WinAPI::fileExists(_fileName);
Server side check which works for run base batch too
publicbooleangetFileExists(filepath _fileName)
{
System.IO.FileInfo fileInfo;
newInteropPermission(InteropKind::ClrInterop).assert();
fileInfo = newSystem.IO.FileInfo(_fileName);
return fileInfo.get_Exists();
}