NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: lkeyser on June 09, 2016, 04:27:36 AM

Title: Scheduled daily task
Post by: lkeyser on June 09, 2016, 04:27:36 AM
Hi everyone
I need some assistance or guidance.
My problem
I have a list of products that need to be flagged, sell by date expired.
I need to run a scheduled task on a daily basis to flag these products.
Where do I add this in the code, or do I need to create an external application and use a timer event on a windows to get this right.
If anyone van help me.
Regards
Louis
Title: Re: Scheduled daily task
Post by: carlitm on June 09, 2016, 07:31:26 AM
Hi

I do this by setting a timer on the WebServer procedure - 360000 = 1 hour

In TakeWindowEvent(), After Parent call I use this code for a BackUp procedure

        DateLastBackup = s_web.GetHostValue('DateLastBackup')
        IF TODAY() > DateLastBackup THEN
            START(BackUpCopy,50000)
            s_web.SetHostValue('DateLastBackup',TODAY())
        END

HTH
Carl
Title: Re: Scheduled daily task
Post by: Bruce on June 13, 2016, 05:13:46 AM
you can do it in a separate program, or on a separate thread from the webServer procedure, as Carl suggests.

cheers
Bruce
Title: Re: Scheduled daily task
Post by: lkeyser on June 13, 2016, 10:50:45 PM
Thanks.

Thanks Carl, Bruce.

Working 100 %

Louis