Hello everyone,
NAV 4.00 SP1:
I hope someone can help me with this problem:
I have designed a form which is based on the virtual Table "File". In the OnOpenForm trigger I filter for a specific directory and a specific file type.
The form then should show me all the files in the specified directory and of the specified file type.
This works, but only the first time when I open this form. After deleting these files and reopening the form they are still shown there. Only after closing the company and a new login the form is presenting a correctly updated content.
The background is that in the specific directory are collected files that have to be imported into a NAV-Table.
The user will look periodically if any files have to be imported. The import will be performed by a dataport which will start by a button click on the mentioned form. All the files in the directory will be processed by the dataport.
If the first time the user looks there are no files he will see no files the whole day even if there have been added a lot of new files.
Any ideas?
--
Josef Snayberk
0
Answers
You need to do the following, looks strange but it is the only thing that works .
make the following code unit, !!! needs to be different code unit then the one with the existing logic !!!
** SI ** Bert Van Gestel **
**********************
For example
File2.SETRANGE(Path,'D:\');
if File2.find('-') then;
File2.SETRANGE(Path,'C:\');
if File2.find('-') then;
As you can see I've changed the filter twice and that does the trick.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
it really does the trick. Thank you.
Bgestel, thanks to you too. But because the ease of use I prefer ara3n´s solution.
Josef Snayberk