timer code

Hi,

How can i code to make a form or message to appear periodically each one hour on Navision ??

thank you

copy the below code and paste to a notepad and import it to navision. change the timing by assigning to NTimer.Interval. There is also a counter. If the counter hits 5 then the timer will stop, you can change according to ur needs. To start , you must run this codeunit. you can put ur code to run this codeunit in codeunit 1 which is application management.

OBJECT Codeunit 99100 My Timer
{
OBJECT-PROPERTIES
{
Date=29-05-06;
Time=13:58:49;
Modified=Yes;
Version List=;
}
PROPERTIES
{
SingleInstance=Yes;
OnRun=BEGIN
IF ISCLEAR(NTimer) THEN
CREATE(NTimer);
NTimer.Interval := 3000;
NTimer.Enabled := TRUE;
END;

}
CODE
{
VAR
NTimer@1000 : Automation “{3B311C81-140E-11D5-8B18-00D0590B4EC5} 1.0:{3B311C92-140E-11D5-8B18-00D0590B4EC5}:‘Navision Timer 1.0’.Timer” WITHEVENTS;
Counter@1001 : Integer;

EVENT [NTimer@1000::Timer@1(Milliseconds@1000](mailto:NTimer@1000::Timer@1(Milliseconds@1000) : Integer);
BEGIN
MESSAGE(‘I was here’);

Counter := Counter + 1;
IF Counter = 5 THEN BEGIN
Counter := 0;
NTimer.Enabled := FALSE;
END;
END;

EVENT [NTimer@1000::TimerError@2(ErrorString@1000](mailto:NTimer@1000::TimerError@2(ErrorString@1000) : Text[1024]);
BEGIN
END;

BEGIN
END.
}
}

thank you armani … I will try it and let you know if it works with my project …thank you again

Its Imran…not Armani…lol…anyway no worries

soryy imran … for my mis spelling

Hi Imran ,

During Giving me a message …couldnot load the selected library …what does it mean …

thank you

Hi Imran

I think I only need the name of the Automation server … Yes it will work with my project … Let me only know the name of this library

thank you again

This is the name of the library ‘Navision Timer 1.0’.Timer. I hope it will work.

I am gettin this message … I really didi once to import one OLE control …Can you remind me how can i do it

the Message is : Navision Timer 1.0’.Timer is neither regonized as a guid nor as the name of an OLE control or Automation Server …Check to see if the entry is misspelled

And By the way even I know little abou t… Can you explain what are Automation server in Navision and from where we can import them ?

Thank Imran for all your concern and help .

It should be working actually. Make sure that you have NTimer.dll file in your Navision folder. it should be in client\common\Navision\Timer , please check it.

Thank you thank you a lot …yes it works …