ocx, dll to detect a new file in an order

RotbaerchiRotbaerchi Member Posts: 8
Hi @ll,

i look for an .ocx or a .dll, that throws an event if it detects a new file in a specified folder. I´d like to use the NAS and a single instance codeunit to control this folder. If there is a new file in the folder, i´d like to import it immediatly.

Has anyone an idea?

Thank´s a lot!

Comments

  • ta5ta5 Member Posts: 1,164
    Hi
    Best you use a loop in a single instance code unit. This loop checks the existence of file every x seconds.

    Hope this helps

    Thomas
  • RotbaerchiRotbaerchi Member Posts: 8
    Thank´s for your answer! :D
  • ta5ta5 Member Posts: 1,164
    BTW:
    If you use the Navision-Timer for the Loop, you can use the ErrorEvent of that automation object. Great for errorhandling/logging, since the parameter errortext contains the complete errortext (similar to getlasterror in Navision 5.0).
  • krikikriki Member, Moderator Posts: 9,110
    1 Remark:
    If you just test with virtual table 2000000022:"File" with some filters on it, before filtering the correct subdir+files, you first have to filter some other subdir and do a FINDFIRST and then put the correct filters and FINDSET.
    This because if you always search the same place, Navision does not update the virtual table and thus you won't find new files.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • BGIBGI Member Posts: 176
    or you set a filter using a \ as last charin the path, and the next time without the \
    Rgds
    Benny Giebens
  • garakgarak Member Posts: 3,263
    or you use the 'Windows Script Host Object Model'.WshShell (WSH).
    There are many functions to handle directories and files.

    regards
    Do you make it right, it works too!
Sign In or Register to comment.