Monday, January 11, 2016

AX 2012: File existance check

Multiple ways to check file existance in AX 2012;

Client side check, does not work with batch job


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();


No comments:

Post a Comment

I will appreciate your comments !

Download large bacpac (sandbox database) to DEV environment much faster

As the LCS website gets slower and slower and the database backups get bigger and bigger.  Use AZCopy to download objects out of LCS asset l...