Thanks Jarek,
I tried with below sample, still the client freeze while the background task is updating the data.
global
updating procedure DoImportTest(string errstr)
begin
longint i;
record INVc INr;
i = 10000;
While (i < 20000) begin
LogText(0,"Step " & i);
RecordNew(INr);
INr.Code = i;
RecordStore(INr,false);
//MilliSleep(500);
i = i + 1;
end;
return;
end;
global
updating procedure ImportTest(string s)
begin
String 255 errstr;
time t;
logtext(0,"scheduling Importtest");
DoImportTest(errstr);
NewPeriodicTask("ImportTest","ImportTest Idle Task","ImportTest","",5,"");
return;
end;
global
updating procedure OnApplicationStartupComplete()
BEGIN
string 255 s;
inner.OnApplicationStartupComplete;
logtext(0,"test");
if (ServerMode or SingleUserMode) then begin
ImportTest(s);
end;
RETURN;
END;