NAVISION & detection new file

houssayenhoussayen Member Posts: 45
hi,
I have a small question about navision, I have a codeunit that can detect the presence on a text file in a directory, if I add a new file, it does not detect except that if I restart Navision.
my question is: I can improve this codeunit so that it can detect adding the new later file without reboot navision?
thanks..

Comments

  • slmaluwaslmaluwa Member Posts: 366
    TIMER can be used.

    From the C/SIDE help
    TimerInterval
    Use this property to tell the system when to execute code contained in the active form's OnTimer trigger.

    Applies to
    Forms

    Settings
    The default value of this property is zero (0). This means that the system will not execute code in the OnTimer trigger.

    You can specify a TimerInterval value in milliseconds ranging from zero to the highest defined integer (corresponding to approx. 25 days).

    Comments
    When you open a form for which you have specified a TimerInterval value, the system executes the OnOpenForm trigger. A timer then starts to count the TimerInterval in milliseconds. Once the specified interval has elapsed, the system will execute the OnTimer trigger. The timer then resets to zero and the system repeats the process until you close the form.

    In some cases, the TimerInterval value specified may be too short to allow the system to complete execution of the OnTimer trigger before starting the next instance of the trigger. In this case, the system notes the number of overlapping instances and executes the trigger continuously as long as necessary.

    Problems with your computer's operating system can affect the absolute performance of the timer.
    "A bove maiore discit arare minor"-"From the old ox, the young one learns to plow."
  • MBergerMBerger Member Posts: 413
    If you are using the File table to detect the files in your folder, then you have to be aware that that table has some issues. To refresh the contents, you need to set the path to another one than the one you are currently in, do a Find, then set it back to the path you want to monitor and do a Find again.
  • houssayenhoussayen Member Posts: 45
    Hi,
    actually, I use the table of files to find the file in a Specific directory, and as you said, I need a refresh of the table
    detect the new file to add, but I did not assimilate well your idea is that you can better explain how I can make this refresh?
    thanks ..
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • houssayenhoussayen Member Posts: 45
    thanks , it worked....;)
Sign In or Register to comment.