Hello all
Currently working on a task that requires scheduling a list item using JSOM.
I did find that this can be done in server side code with the following code
using (SPSite site = new SPSite("http://serverName:1111/"))
{
using (SPWeb web = site.RootWeb)
{
SPList list=web.Lists["Doc Library"];
SPListItem listItem = list.GetItemById(1);
ScheduledItem scheduledItem = null;
if (ScheduledItem.IsScheduledItem(listItem))
{
scheduledItem = ScheduledItem.GetScheduledItem(listItem);
}
else
{
throw new System.ArgumentException
("SPListItem must support scheduling","listItem");
}
DateTime startDate = new DateTime(2011, 4, 6, 22, 50, 00);
DateTime endDate = new DateTime(2011, 4, 6, 22, 51, 00);
scheduledItem.StartDate = startDate;
scheduledItem.EndDate = endDate;
scheduledItem.ListItem.Update();
scheduledItem.Schedule();
}
}I would like to do the scheduling using JSOM in a button click.
I did a search for the js equivalent for this scheduled item and found this.
But am not sure how to use this.
Need your help on this.
Thanks in advance