Using the system table "File" to find files in a directory.
The code is run by NAS and the codeunit is set to SingleInstance=Yes
Version of Navision: 4 SP3
The problem is that after a while new files are not found, but after restarting NAS the files are found.
Any ideas anyone?
The code:
ImportFiles.RESET;
SELECTLATESTVERSION;
ImportFiles.SETFILTER(Path, Setup."Path Importfiles");
ImportFiles.SETRANGE("Is a file",TRUE);
ImportFiles.SETFILTER(Name, '%1', Setup."Filename Mask");
IF ImportFiles.FIND('-') THEN
REPEAT
[ code to handle the files ]
UNTIL (ImportFiles.NEXT = 0);
0
Answers
If yes then the loop may break too early. I had similar problems and solved it using a buffer table containing the file names to operate the loop on.
Hope this helps.
Thomas
I've checked the funktion and it does capture all the files at the moment and processed them.
The issue is that later in time new files will not be found. This routine runs once every minute.
Files ar found as they occur, and it works like for a couple of hours and then the problem shows.
Try this:
viewtopic.php?f=23&t=26766
RIS Plus, LLC
MVP - Business Apps
Looks like it was the "cache" problem...