On Time Trigger

Hello Folks, Have anyone a sample for “how to use the on Time Trigger in a From” Many Thanks ------------------ Best regards Alejandro Schubert EMail: alejandro.schubert@cycos.com

Sure, assume you have a kind of “Dispatcher” looking for files in a specific directory, and is to take action whenever an inbound file arrives. OnTimer() IF EXIST(‘myfile.ext’) THEN CallCodeToImportFile; Remember to set the property TimerInterval to set the desired time which the system has to run the trigger. This is a very simple example, but thats what you asked for. /Soren

Thanks,it works! Okay, and who is the property Timeinterval in the form defined? 1 is 1millisec ? 1000 one sec? … ------------------ Best regards Alejandro Schubert System Engineer EMail: alejandro.schubert@cycos.com

As it says in the online help: --------- You can specify a TimerInterval value in milliseconds ranging from zero to the highest defined integer (corresponding to approx. 25 days). ------------ /Soren

b Edited by - Alex on 2001 Mar 02 12:58:55

Another simple example, with a complete form. I starts a report at a predefined time. OBJECT Form 50069 Batch create prod. proposals { OBJECT-PROPERTIES { Date=00-10-30; Time=[ 2:01:00]; Version List=SMAB PL; } PROPERTIES { Width=7700; Height=2310; TimerInterval=10000; OnOpenForm=BEGIN EVALUATE(TimeSet, ‘21:00:00’); END; OnTimer=BEGIN IF ((TIME > TimeSet) AND (BatchStarted = FALSE)) THEN BEGIN TheCode; END; END; } CONTROLS { { 4 ;TextBox ;4290 ;440 ;1650 ;440 ;CaptionML=ENU=Time Set; SourceExpr=TimeSet } { 5 ;Label ;880 ;440 ;3300 ;440 ;ParentControl=4 } { 1 ;CommandButton;4290 ;1320 ;1650 ;500 ;CaptionML=ENU=Start now; OnPush=BEGIN TheCode; END; } } CODE { VAR TimeSet : Time; BatchStarted : Boolean; SkapaProdF”rsl : Report 50051; PROCEDURE TheCode@1(); BEGIN BatchStarted := TRUE; SkapaProdF”rsl.InitBatchjobb; SkapaProdF”rsl.USEREQUESTFORM(FALSE); SkapaProdF”rsl.RUNMODAL; CLEAR(SkapaProdF”rsl); CurrForm.CLOSE; END; BEGIN END. } } Pelle

Very nice guys but you think Navision could have trusted us with a codeunit timer event we could leave running without a form… Add it to the wish list with the “Fields collection” and data retrieval by field “No.”…sigh! Just in case NS are monitoring this forum! David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk

Yes, and please give us the opportunity to set the TimerInterval programmically. Marcus