NewPeriodicTask
Lee D Papworth
8-4-18
Seems my original post has been deleted. So I am posting again and would appreciate some technical advice. (Please do not delete my post)

Erik suggested in a Skype chat with a colleague several weeks ago that we look at using NewPeriodicTask2 rather than the Background Hal routine in Timed Operations.

I cannot get NewPeriodTask2 to work but NewPeriodicTask works but I have several questions.

1) What is the difference between NewPeriodicTask and NewPeriodTask2?
2) In standalone mode running Single User Server I can use these commands ChangeTaskTiming, RemoveTask, TaskExists However in normal client server mode these do not work for me. It is as though it cannot find the task. I use the TaskExists command to check if active before issuing ChangeTaskTiming. Any ideas why these command wouldn't be working in server mode?

For reference I include below the hal code I have for application startup.

external updating function SDProcessUserXml(string);
external updating function SDProcessOrderXml(string);


global
updating procedure OnApplicationStartupComplete()
begin


record SDTradeITBlock SDTBr;
blockload(SDTBr);

inner.OnApplicationStartupComplete;
if (ServerMode or SingleUserMode) then begin
if (SDTBr.UserImportSeconds >0) then begin
NewPeriodicTask("SDProcessUserXml","Auto Import Users","SDProcessUserXml","Auto",SDTBr.UserImportSeconds,"");
Logtext(0,"Starting Timed Task - Auto Import Users");
end;
if (SDTBr.OrderImportSeconds >0) then begin
NewPeriodicTask("SDProcessOrderXml","Auto Import Order","SDProcessOrderXml","Auto",SDTBr.OrderImportSeconds,"");
Logtext(0,"Starting Timed Task - Auto Import Orders");
end;
end;

return;
end;
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Latest Posts
Piotr Wycichowski
Is it something when a user tried to use any of AI commands in SERP? /Piotr W....
10:07 8 Nov 2024
Brittany McGrath
Thank you for your post Lilian. I see this post has been submitted twice and the second post is being addressed so I will close this duplicate. Thank you. ...
09:41 5 Nov 2024