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
public boolean
getFileExists(filepath _fileName)
{
System.IO.FileInfo fileInfo;
new
InteropPermission(InteropKind::ClrInterop).assert();
fileInfo = new
System.IO.FileInfo(_fileName);
return fileInfo.get_Exists();
}
Comments
Post a Comment
I will appreciate your comments !