sleeping Codeunit or Form ( like watchdog )

Who helps, I’m running NAVISION-Financials 2.00 It must run on a WIN98-Client I’ve the following problem : I need to write a codeunit which is always active in the Navision-system, (started from Codeunit 1) such like a watchdog. This unit has to look every x minutes if there is a specific record in a table. This could be a codeunit or a form. 1. how can I get start this. RUN, or ??? 2. how to activate after x minutes ? SLEEP doesn’t work. May be you have an example for me. Rolf Heinsohn

quote:


Originally posted by Heinsohn: 2. how to activate after x minutes ? SLEEP doesn’t work.


Are you sure ? I’m using it and it works for me. So there some sugestions: Modify codeunit 1: If USERID=‘CYCLE’ THEN … Use Dialog to indicate process, in this way you will able to interupt cycle. Don’t use: SLEEP(600000) //sleep fo 10 min. there in ms use cycle with 200-1000 sleeps. So, now your fin.exe isn’t stoned. Another problem is data refresh. Use SELECTLATESTVERSION.

Rolf : Have a look in Navision Attain at Form 6094 Job Scheduler Management And take a look at the OnTimer Trigger Please take note of the use of COMMIT and SELECTLATESTVERSION commands there, which are important to perform in this particular trigger when readind/updating data. Good Luck! tarek_demiati@ureach.com Edited by - Tarek Demiati on 2001 Aug 20 09:55:22

Hi Rolf! For using the OnTimer-Trigger in Forms, you have to upgrade to NF 2.01 ! (C/SIDE only would be enough!). Then you could set a TimerIntervall, maybe of the form “Main Menu”, to process your “watchdog”, some code triggerd in OnTimer(). Regards, Jörg P.S.: We do some similar processing, it works fine ! Joerg A. Stryk Apollo-Optik, IT/ERP Edited by - stryk on 2001 Aug 21 08:34:03

Hello to all, thanks for your really good recommendations. In the meantime we have upgraded to Vers. 2.01b and it works very good with the On-Timer-Trigger. So again thanks to all, and up to the next time. Rolf Heinsohn