+1-888-365-2779
Try Now
More in this section

Job Scheduler

6 posts, 0 answered
  1. Nadya
    Nadya avatar
    52 posts
    Registered:
    17 Dec 2008
    19 Nov 2009
    Link to this post
    Hello !

    I am developing a online shop using Sitefinity 3.7 SP 1. The thing is that I do not have users - everybody can buy. So my DB table with orders grows and at some point - let's say 5 days after a order is made it is no more relevant to anything. So here's my question - does Sitefinity has some kind of job scheduler functionality so I can erase orders automatically after certain period of time?

    If so - how can I enable it and use it ?
    If not what would you suggest ?

    Thank you very much!

    Best Nadya Atanasova 
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    19 Nov 2009
    Link to this post
    Hi Nadya,

    So here's my question - does Sitefinity has some kind of job scheduler functionality so I can erase orders automatically after certain period of time?

    We will support this from Sitefinity 4.0.

    Currently you can create a SQL Scheduled Tasks (Run the SQL Enterprise Manager, Select Server >> Management >> Agent)

    Another option is adding some login on application start because it is frequently requested and getting the items Date_Creation ( or Publication_Date), then comparing this value to DateTimeNow. If the difference is more that 5 days delete the item through API.

    Sample code with content item object

    var cManager = new ContentManager("MyProvider");
    IList listAll = cManager.GetContent(0, 20, "Publication_Date DESC");
    foreach (IContent cnt in listAll)
    {
        string md = (string)cnt.GetMetaData("Publication_Date");
        //parse the sting to the data time
        int y;
        int m;
        int d;
        DateTime ItemDate = new DateTime(y, m, d);
        DateTime cTime = DateTime.Now;
        TimeSpan timeSpan = cTime.Subtract(ItemDate);
        // delete the content if the date is greather than 5 days...
        Response.Write(timeSpan.TotalDays.ToString());
        
    }


    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Preetham Reddy
    Preetham Reddy avatar
    57 posts
    Registered:
    16 Jul 2012
    22 Dec 2010
    Link to this post
    It was mentioned here that Job Scheduling will be provided in Sitefinity 4.0. I guess not :(

    Looking forward for it in the future revisions...
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    27 Dec 2010
    Link to this post
    Hello,

    In 4.0, you can schedule and unpublish an item.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Preetham Reddy
    Preetham Reddy avatar
    57 posts
    Registered:
    16 Jul 2012
    27 Dec 2010
    Link to this post
    Hi Ivan,

    I understand you can publish your content items at a scheduled time. But can we execute a function in a DLL at periodic intervals to perform some actions.

    For example if you have a function PurgeOldDate() that you would like to call every night to delete unnecessary data.

    Can you schedule Sitefinity to call this function every night at 12:00 AM? DotNetNuke provides this capability at this point and it provides a pretty good API too...

    http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/05/11/how-to-create-dotnetnuke-dnn-scheduler.aspx

    This is what I meant by Job Scheduler.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Dec 2010
    Link to this post
    Hi Preetham,

    We are working on a schedule service that will allow you to have recurring events. We have the infrastructure, but the implementation is not completed. I hope that we will manage to finish it for the official release.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
6 posts, 0 answered