Creating SharePoint Calendar All Day or Daily Recurring Event

Published May 01 2019 04:06 PM 414 Views
Microsoft

First published on TECHNET on Oct 09, 2017
This post is a contribution from Manish Joshi, an engineer with the SharePoint Developer Support team

Whether you are creating a daily recurring event using SharePoint web service lists.asmx or via REST calls, you will need to make sure that TimeZone property is set to 0 otherwise the SharePoint calendar recurring event will be created but on random instances of the events items you will get following error message:

“Item does not exist. It may have been deleted by another user”

Sample codes below:

Sample code using Lists.asmx web service

Below is the sample XML passed to SharePoint lists.asmx.



var sDoc = "<Batch OnError=\"Continue\">" +
" <Method ID=\"1\" Cmd=\"New\">" +
" <Field Name=\"Category\"><![CDATA[Meeting]]></Field>" +
" <Field Name=\"EndDate\"><![CDATA[2017-07-27T239:59:00Z]]></Field>" +
" <Field Name=\"EventDate\"><![CDATA[2017-07-13T09:00:00Z]]></Field>" +
" <Field Name=\"EventType\"><![CDATA[1]]></Field>" +
" <Field Name=\"fAllDayEvent\"><![CDATA[1]]></Field>" +
" <Field Name=\"fRecurrence\"><![CDATA[1]]></Field>" +
" <Field Name=\"Location\"><![CDATA[Redmomd]]></Field>" +
" <Field Name=\"RecurrenceData\"><![CDATA[<recurrence><rule><firstDayOfWeek>su</firstDayOfWeek><repeat><daily weekday='TRUE' /></repeat><windowEnd>2017-07-27T23:59:00Z</windowEnd></rule></recurrence>]]></Field>" +
" <Field Name=\"Description\"><![CDATA[Daily Recurrence.]]></Field>" +
" <Field Name=\"Title\"><![CDATA[Daily 6]]></Field>" +
" <Field Name=\"UID\"><![CDATA[{" + Guid.NewGuid() + "}]]></Field>" +
" <Field Name=\"TimeZone\"><![CDATA[0]]></Field>" +
" </Method>" +
" </Batch>";




Below is the complete sample code.



using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;

namespace CreateRecurringEvent
{
class Program
{
private static int GetWorkdays(DateTime start, DateTime end)
{
int days = 0;

while (start <= end)
{
var day = start.DayOfWeek;
if (!(day == DayOfWeek.Saturday || day == DayOfWeek.Sunday))
{
days++;
}

start = start.AddDays(1);
}

return days;
}

static void Main(string[] args)
{

ListsService.Lists lists = new ListsService.Lists();
lists.UseDefaultCredentials = true;
lists.Url = "http://sp/_vti_bin/lists.asmx";


var start = DateTime.Parse("2017-11-13");
var end = DateTime.Parse("2017-12-27");
string title = "Test Recurrence";


var recurrenceDataXml = new XElement("recurrence",
new XElement("rule",
new XElement("firstDayOfWeek", "su"),
new XElement("repeat",
new XElement("weekly",
new XAttribute("mo", "TRUE"),
new XAttribute("tu", "TRUE"),
new XAttribute("we", "TRUE"),
new XAttribute("th", "TRUE"),
new XAttribute("fr", "TRUE"),
new XAttribute("weekFrequency", "1"))),
new XElement("repeatInstances", GetWorkdays(start, end))));

var recurrenceDataString = recurrenceDataXml.ToString();

var newEventXml = new XDocument(
new XElement("Batch",
new XAttribute("OnError", "Continue"),
new XAttribute("ListVersion", "1"),
new XAttribute("ViewName", ""),
new XElement("Method",
new XAttribute("ID", "1"),
new XAttribute("Cmd", "New"),
new XElement("Field", new XAttribute("Name", "Title"), title),
new XElement("Field", new XAttribute("Name", "EventDate"), String.Format("{0:yyyy'-'MM'-'dd 00':'00':'00}", start)),
new XElement("Field", new XAttribute("Name", "EndDate"), String.Format("{0:yyyy'-'MM'-'dd 23':'59':'00}", end)),
new XElement("Field", new XAttribute("Name", "fAllDayEvent"), "1"),
new XElement("Field", new XAttribute("Name", "fRecurrence"), "1"),
new XElement("Field", new XAttribute("Name", "Duration"), 86340),
new XElement("Field", new XAttribute("Name", "EventType"), "1"),
new XElement("Field", new XAttribute("Name", "UID"), "{" + Guid.NewGuid() + "}"),
new XElement("Field", new XAttribute("Name", "TimeZone"), "0"),
new XElement("Field", new XAttribute("Name", "RecurrenceData"),
new XCData(recurrenceDataString)))));

var doc = new XmlDocument();
using (var reader = newEventXml.CreateReader())
doc.Load(reader);

System.Xml.XmlNode result = lists.UpdateListItems("Calendar", doc);

XmlTextReader xr = new XmlTextReader(result.OuterXml, XmlNodeType.Element, null);
while (xr.Read())
{
if (xr.ReadToFollowing("z:row"))
{
if (xr["ows_ID"] != null)
{
Console.WriteLine(xr["ows_ID"].ToString());
}
}
}

Console.WriteLine("Done...!");
Console.ReadLine();

}

}
}




Sample REST call in Script Editor Web Part:
Below code demonstrates creation of the recurring event using REST API



<div><button type="button" onclick="CreateDailyRecurringEvent()">Create Daily Recurring Event</button></div>
<br><br>
<div id="Status"></div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>

<script type="text/javascript">
function createGuid()
{
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);
return v.toString(16);
});
}
var guid = createGuid();
function CreateDailyRecurringEvent()
{
//create a string that has the events
var stringStartDate = "2017-07-13T08:00:00Z";
var stringEndDate = "2017-07-27T23:59:00Z";
var reccurenceString = "<recurrence><rule><firstDayOfWeek>su</firstDayOfWeek><repeat><daily weekday='TRUE' /></repeat><windowEnd>2017-07-27T23:59:00Z</windowEnd></rule></recurrence>";
var recReq =
{
url: "http://sp/_api/web/lists/GetByTitle('Events')/items",
type: "POST",
data: JSON.stringify({
'__metadata': {
'type': 'SP.ListItem'
},
'Title': 'Daily 5',
'EventDate': stringStartDate,
'EndDate': stringEndDate,
'Location': 'Seattle',
'Description': 'Daily 5',
'Category': 'Meeting',
'fRecurrence': true,
'fAllDayEvent': true,
'RecurrenceData': reccurenceString,
'TimeZone': 0,
'UID': guid,
'EventType': 1
}),
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
success :function () {
alert("Event data saved.");
},
error:function (err) {
alert("Error occurred while saving question data.");
console.log("ERROR", err);
}
};

jQuery.ajax(recReq);
}
</script>

%3CLINGO-SUB%20id%3D%22lingo-sub-510009%22%20slang%3D%22en-US%22%3ECreating%20SharePoint%20Calendar%20All%20Day%20or%20Daily%20Recurring%20Event%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-510009%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3EFirst%20published%20on%20TECHNET%20on%20Oct%2009%2C%202017%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3EThis%20post%20is%20a%20contribution%20from%20Manish%20Joshi%2C%20an%20engineer%20with%20the%20SharePoint%20Developer%20Support%20team%20%3CBR%20%2F%3E%3CBR%20%2F%3EWhether%20you%20are%20creating%20a%20daily%20recurring%20event%20using%20SharePoint%20web%20service%20lists.asmx%20or%20via%20REST%20calls%2C%20you%20will%20need%20to%20make%20sure%20that%20TimeZone%20property%20is%20set%20to%200%20otherwise%20the%20SharePoint%20calendar%20recurring%20event%20will%20be%20created%20but%20on%20random%20instances%20of%20the%20events%20items%20you%20will%20get%20following%20error%20message%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CEM%3E%20%E2%80%9CItem%20does%20not%20exist.%20It%20may%20have%20been%20deleted%20by%20another%20user%E2%80%9D%20%3C%2FEM%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CEM%3E%20%3CSTRONG%3E%20Sample%20codes%20below%3A%20%3C%2FSTRONG%3E%20%3C%2FEM%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3ESample%20code%20using%20Lists.asmx%20web%20service%20%3CBR%20%2F%3E%3CBR%20%2F%3EBelow%20is%20the%20sample%20XML%20passed%20to%20SharePoint%20lists.asmx.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CDIV%3E%3CBR%20%2F%3Evar%20sDoc%20%3D%20%22%3CBATCH%20onerror%3D%22%5C%26quot%3BContinue%5C%26quot%3B%22%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CMETHOD%20id%3D%22%5C%26quot%3B1%5C%26quot%3B%22%20cmd%3D%22%5C%26quot%3BNew%5C%26quot%3B%22%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CFIELD%20name%3D%22%5C%26quot%3BCategory%5C%26quot%3B%22%3EMeeting%3C%2FFIELD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CFIELD%20name%3D%22%5C%26quot%3BEndDate%5C%26quot%3B%22%3E2017-07-27T239%3A59%3A00Z%3C%2FFIELD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CFIELD%20name%3D%22%5C%26quot%3BEventDate%5C%26quot%3B%22%3E2017-07-13T09%3A00%3A00Z%3C%2FFIELD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CFIELD%20name%3D%22%5C%26quot%3BEventType%5C%26quot%3B%22%3E1%3C%2FFIELD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CFIELD%20name%3D%22%5C%26quot%3BfAllDayEvent%5C%26quot%3B%22%3E1%3C%2FFIELD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CFIELD%20name%3D%22%5C%26quot%3BfRecurrence%5C%26quot%3B%22%3E1%3C%2FFIELD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CFIELD%20name%3D%22%5C%26quot%3BLocation%5C%26quot%3B%22%3ERedmomd%3C%2FFIELD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CFIELD%20name%3D%22%5C%26quot%3BRecurrenceData%5C%26quot%3B%22%3E%26lt%3Brecurrence%26gt%3B%26lt%3Brule%26gt%3B%26lt%3BfirstDayOfWeek%26gt%3Bsu%26lt%3B%2FfirstDayOfWeek%26gt%3B%26lt%3Brepeat%26gt%3B%26lt%3Bdaily%20weekday%3D%26amp%3B%2339%3BTRUE%26amp%3B%2339%3B%20%2F%26gt%3B%26lt%3B%2Frepeat%26gt%3B%26lt%3BwindowEnd%26gt%3B2017-07-27T23%3A59%3A00Z%26lt%3B%2FwindowEnd%26gt%3B%26lt%3B%2Frule%26gt%3B%26lt%3B%2Frecurrence%26gt%3B%3C%2FFIELD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CFIELD%20name%3D%22%5C%26quot%3BDescription%5C%26quot%3B%22%3EDaily%20Recurrence.%3C%2FFIELD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CFIELD%20name%3D%22%5C%26quot%3BTitle%5C%26quot%3B%22%3EDaily%206%3C%2FFIELD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CFIELD%20name%3D%22%5C%26quot%3BUID%5C%26quot%3B%22%3E%7B%26amp%3Bquot%3B%20%2B%20Guid.NewGuid()%20%2B%20%26amp%3Bquot%3B%7D%3C%2FFIELD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3CFIELD%20name%3D%22%5C%26quot%3BTimeZone%5C%26quot%3B%22%3E0%3C%2FFIELD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3C%2FMETHOD%3E%22%20%2B%20%3CBR%20%2F%3E%22%20%3C%2FBATCH%3E%22%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FDIV%3E%0A%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EBelow%20is%20the%20complete%20sample%20code.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CDIV%3E%3CBR%20%2F%3Eusing%20System%3B%20%3CBR%20%2F%3Eusing%20System.Collections.Generic%3B%20%3CBR%20%2F%3Eusing%20System.Linq%3B%20%3CBR%20%2F%3Eusing%20System.Net%3B%20%3CBR%20%2F%3Eusing%20System.Text%3B%20%3CBR%20%2F%3Eusing%20System.Threading.Tasks%3B%20%3CBR%20%2F%3Eusing%20System.Xml%3B%20%3CBR%20%2F%3Eusing%20System.Xml.Linq%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3Enamespace%20CreateRecurringEvent%20%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3Eclass%20Program%20%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3Eprivate%20static%20int%20GetWorkdays(DateTime%20start%2C%20DateTime%20end)%20%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3Eint%20days%20%3D%200%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3Ewhile%20(start%20%26lt%3B%3D%20end)%20%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3Evar%20day%20%3D%20start.DayOfWeek%3B%20%3CBR%20%2F%3Eif%20(!(day%20%3D%3D%20DayOfWeek.Saturday%20%7C%7C%20day%20%3D%3D%20DayOfWeek.Sunday))%20%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3Edays%2B%2B%3B%20%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E%3CBR%20%2F%3Estart%20%3D%20start.AddDays(1)%3B%20%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E%3CBR%20%2F%3Ereturn%20days%3B%20%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E%3CBR%20%2F%3Estatic%20void%20Main(string%5B%5D%20args)%20%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3E%3CBR%20%2F%3EListsService.Lists%20lists%20%3D%20new%20ListsService.Lists()%3B%20%3CBR%20%2F%3Elists.UseDefaultCredentials%20%3D%20true%3B%20%3CBR%20%2F%3Elists.Url%20%3D%20%22http%3A%2F%2Fsp%2F_vti_bin%2Flists.asmx%22%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3Evar%20start%20%3D%20DateTime.Parse(%222017-11-13%22)%3B%20%3CBR%20%2F%3Evar%20end%20%3D%20DateTime.Parse(%222017-12-27%22)%3B%20%3CBR%20%2F%3Estring%20title%20%3D%20%22Test%20Recurrence%22%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3Evar%20recurrenceDataXml%20%3D%20new%20XElement(%22recurrence%22%2C%20%3CBR%20%2F%3Enew%20XElement(%22rule%22%2C%20%3CBR%20%2F%3Enew%20XElement(%22firstDayOfWeek%22%2C%20%22su%22)%2C%20%3CBR%20%2F%3Enew%20XElement(%22repeat%22%2C%20%3CBR%20%2F%3Enew%20XElement(%22weekly%22%2C%20%3CBR%20%2F%3Enew%20XAttribute(%22mo%22%2C%20%22TRUE%22)%2C%20%3CBR%20%2F%3Enew%20XAttribute(%22tu%22%2C%20%22TRUE%22)%2C%20%3CBR%20%2F%3Enew%20XAttribute(%22we%22%2C%20%22TRUE%22)%2C%20%3CBR%20%2F%3Enew%20XAttribute(%22th%22%2C%20%22TRUE%22)%2C%20%3CBR%20%2F%3Enew%20XAttribute(%22fr%22%2C%20%22TRUE%22)%2C%20%3CBR%20%2F%3Enew%20XAttribute(%22weekFrequency%22%2C%20%221%22)))%2C%20%3CBR%20%2F%3Enew%20XElement(%22repeatInstances%22%2C%20GetWorkdays(start%2C%20end))))%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3Evar%20recurrenceDataString%20%3D%20recurrenceDataXml.ToString()%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3Evar%20newEventXml%20%3D%20new%20XDocument(%20%3CBR%20%2F%3Enew%20XElement(%22Batch%22%2C%20%3CBR%20%2F%3Enew%20XAttribute(%22OnError%22%2C%20%22Continue%22)%2C%20%3CBR%20%2F%3Enew%20XAttribute(%22ListVersion%22%2C%20%221%22)%2C%20%3CBR%20%2F%3Enew%20XAttribute(%22ViewName%22%2C%20%22%22)%2C%20%3CBR%20%2F%3Enew%20XElement(%22Method%22%2C%20%3CBR%20%2F%3Enew%20XAttribute(%22ID%22%2C%20%221%22)%2C%20%3CBR%20%2F%3Enew%20XAttribute(%22Cmd%22%2C%20%22New%22)%2C%20%3CBR%20%2F%3Enew%20XElement(%22Field%22%2C%20new%20XAttribute(%22Name%22%2C%20%22Title%22)%2C%20title)%2C%20%3CBR%20%2F%3Enew%20XElement(%22Field%22%2C%20new%20XAttribute(%22Name%22%2C%20%22EventDate%22)%2C%20String.Format(%22%7B0%3Ayyyy'-'MM'-'dd%2000'%3A'00'%3A'00%7D%22%2C%20start))%2C%20%3CBR%20%2F%3Enew%20XElement(%22Field%22%2C%20new%20XAttribute(%22Name%22%2C%20%22EndDate%22)%2C%20String.Format(%22%7B0%3Ayyyy'-'MM'-'dd%2023'%3A'59'%3A'00%7D%22%2C%20end))%2C%20%3CBR%20%2F%3Enew%20XElement(%22Field%22%2C%20new%20XAttribute(%22Name%22%2C%20%22fAllDayEvent%22)%2C%20%221%22)%2C%20%3CBR%20%2F%3Enew%20XElement(%22Field%22%2C%20new%20XAttribute(%22Name%22%2C%20%22fRecurrence%22)%2C%20%221%22)%2C%20%3CBR%20%2F%3Enew%20XElement(%22Field%22%2C%20new%20XAttribute(%22Name%22%2C%20%22Duration%22)%2C%2086340)%2C%20%3CBR%20%2F%3Enew%20XElement(%22Field%22%2C%20new%20XAttribute(%22Name%22%2C%20%22EventType%22)%2C%20%221%22)%2C%20%3CBR%20%2F%3Enew%20XElement(%22Field%22%2C%20new%20XAttribute(%22Name%22%2C%20%22UID%22)%2C%20%22%7B%22%20%2B%20Guid.NewGuid()%20%2B%20%22%7D%22)%2C%20%3CBR%20%2F%3Enew%20XElement(%22Field%22%2C%20new%20XAttribute(%22Name%22%2C%20%22TimeZone%22)%2C%20%220%22)%2C%20%3CBR%20%2F%3Enew%20XElement(%22Field%22%2C%20new%20XAttribute(%22Name%22%2C%20%22RecurrenceData%22)%2C%20%3CBR%20%2F%3Enew%20XCData(recurrenceDataString)))))%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3Evar%20doc%20%3D%20new%20XmlDocument()%3B%20%3CBR%20%2F%3Eusing%20(var%20reader%20%3D%20newEventXml.CreateReader())%20%3CBR%20%2F%3Edoc.Load(reader)%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3ESystem.Xml.XmlNode%20result%20%3D%20lists.UpdateListItems(%22Calendar%22%2C%20doc)%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3EXmlTextReader%20xr%20%3D%20new%20XmlTextReader(result.OuterXml%2C%20XmlNodeType.Element%2C%20null)%3B%20%3CBR%20%2F%3Ewhile%20(xr.Read())%20%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3Eif%20(xr.ReadToFollowing(%22z%3Arow%22))%20%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3Eif%20(xr%5B%22ows_ID%22%5D%20!%3D%20null)%20%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3EConsole.WriteLine(xr%5B%22ows_ID%22%5D.ToString())%3B%20%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E%3CBR%20%2F%3EConsole.WriteLine(%22Done...!%22)%3B%20%3CBR%20%2F%3EConsole.ReadLine()%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FDIV%3E%0A%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3ESample%20REST%20call%20in%20Script%20Editor%20Web%20Part%3A%20%3CBR%20%2F%3EBelow%20code%20demonstrates%20creation%20of%20the%20recurring%20event%20using%20REST%20API%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CBUTTON%20type%3D%22%26quot%3Bbutton%26quot%3B%22%20onclick%3D%22%26quot%3BCreateDailyRecurringEvent()%26quot%3B%22%3ECreate%20Daily%20Recurring%20Event%3C%2FBUTTON%3E%3C%2FDIV%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CDIV%20id%3D%22%26quot%3BStatus%26quot%3B%22%3E%3C%2FDIV%3E%20%3CBR%20%2F%3E%3CSCRIPT%20type%3D%22%26quot%3Btext%2Fjavascript%26quot%3B%22%20src%3D%22%26quot%3B%26lt%3BA%22%20href%3D%22https%3A%2F%2Fcode.jquery.com%2Fjquery-3.2.1.min.js%26quot%3B%26gt%3B%26lt%3B%2Fscript%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fcode.jquery.com%2Fjquery-3.2.1.min.js%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2Fscript%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FA%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3Bscript%20type%3D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Btext%2Fjavascript%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bfunction%20createGuid()%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Breturn%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3Bxxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B.replace(%2F%5Bxy%5D%2Fg%2C%20function(c)%20%7B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bvar%20r%20%3D%20Math.random()*16%7C0%2C%20v%20%3D%20c%20%3D%3D%3D%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3Bx%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%20%3F%20r%20%3A%20(r%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3B0x3%7C0x8)%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Breturn%20v.toString(16)%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D)%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bvar%20guid%20%3D%20createGuid()%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bfunction%20CreateDailyRecurringEvent()%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%2F%2Fcreate%20a%20string%20that%20has%20the%20events%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bvar%20stringStartDate%20%3D%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B2017-07-13T08%3A00%3A00Z%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bvar%20stringEndDate%20%3D%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B2017-07-27T23%3A59%3A00Z%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bvar%20reccurenceString%20%3D%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3Brecurrence%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3Brule%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BfirstDayOfWeek%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bsu%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FfirstDayOfWeek%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3Brepeat%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3Bdaily%20weekday%3D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BTRUE%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2Frepeat%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BwindowEnd%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B2017-07-27T23%3A59%3A00Z%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FwindowEnd%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2Frule%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2Frecurrence%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bvar%20recReq%20%3D%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Burl%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Bhttp%3A%2F%2Fsp%2F_api%2Fweb%2Flists%2FGetByTitle(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BEvents%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B)%2Fitems%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Btype%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BPOST%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bdata%3A%20JSON.stringify(%7B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B__metadata%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%20%7B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3Btype%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BSP.ListItem%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BTitle%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BDaily%205%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BEventDate%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%20stringStartDate%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BEndDate%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%20stringEndDate%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BLocation%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BSeattle%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BDescription%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BDaily%205%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BCategory%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BMeeting%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BfRecurrence%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%20true%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BfAllDayEvent%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%20true%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BRecurrenceData%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%20reccurenceString%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BTimeZone%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%200%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BUID%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%20guid%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BEventType%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3A%201%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D)%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bheaders%3A%20%7B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Baccept%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Bapplication%2Fjson%3Bodata%3Dverbose%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Bcontent-type%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Bapplication%2Fjson%3Bodata%3Dverbose%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BX-RequestDigest%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%3A%20%24(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%23__REQUESTDIGEST%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B).val()%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bsuccess%20%3Afunction%20()%20%7B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Balert(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BEvent%20data%20saved.%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Berror%3Afunction%20(err)%20%7B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Balert(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BError%20occurred%20while%20saving%20question%20data.%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bconsole.log(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BERROR%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20err)%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3BjQuery.ajax(recReq)%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%3C%2FSCRIPT%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-510009%22%20slang%3D%22en-US%22%3E%3CP%3EFirst%20published%20on%20TECHNET%20on%20Oct%2009%2C%202017%20This%20post%20is%20a%20contribution%20from%20Manish%20Joshi%2C%20an%20engineer%20with%20the%20SharePoint%20Developer%20Support%20teamWhether%20you%20are%20creating%20a%20daily%20recurring%20event%20using%20SharePoint%20web%20service%20lists.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-510009%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Sep 01 2020 02:22 PM
Updated by: