Updating a form based on the virtual table "Fi
jsnayberk
Member Posts: 58
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?
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
Josef Snayberk
0
Answers
-
Hi,
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 !!!OBJECT Codeunit 52011 File update { OBJECT-PROPERTIES { Date=21-03-05; Time=16:25:08; Modified=Yes; Version List=FORYOU; } PROPERTIES { TableNo=2000000022; OnRun=BEGIN File2.SETRANGE(Path,'C:\'); IF File2.FIND('-') THEN; END; } CODE { VAR File2@1000000000 : Record 2000000022; BEGIN END. } }**********************
** SI ** Bert Van Gestel **
**********************0 -
hello, what you need to do is change the filter to something else and then back to original value and it shoudl work.
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.0 -
Hi 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 Snayberk0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 323 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

