How to Reset the Time Interval

ajaybabuChajaybabuCh Member Posts: 208
Hi

I have to run some process in Navison daily at 7 PM by taking the starting time of the NAS.


suppose if I started NAS at 1 PM, then I'll set the timeinterval after 6 hours
for the first time and from next time I reset the timerinterval to next 24 hours through code in the single instance codeunit running by the nas.

but its not working in that way.

Name DataType
Timer Automation 'Commerce Gateway Timer'.Timer
TimeInterval Integer. (suppose that initially it has 300000 for 5 minutes)

IF ISCLEAR(Timer) THEN
CREATE(Timer);

Timer.Interval:=TimeInterval;
IF Timer.Enable THEN;

i ran my process for 5 minutes , next time i want to run the process
after 30 minutes

after running the process i changed the TimeInterval variable to
TimeInterval = 600000 in the TimerEvent

but its not working.

The following is My single Instance codeunit

OnRun

TimeInterval:=300000 //first want to run after 5 minutes
IF ISCLEAR(Timer) THEN
CREATE(Timer);


Timer.Interval:=TimeInterval;
IF Timer.Enable THEN;

Timer::TimerEven()
{
// code to run some process
}
TimeInterval = 600000 // next time want to run for 10 minutes which in not effecting


cananybody give me any idea on this
Ajay

Comments

Sign In or Register to comment.