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
David Delač
Hi Piotr, The log entry:
2024-12-14 08:40:43 0.000 CallHal(IsHansaWorldCustomer) appears because the server is running with the verbosity=debug-detailed setting in its parameters.txt file. Thi...
09:43 16 Dec 2024
Brittany McGrath
Hi Vaughn, I can confirm this has been fixed now and is live in Standard ERP 2024-11-20 Version: 85556786. Thank you. ...
10:04 10 Dec 2024