This project has moved and is read-only. For the latest updates, please go here.

Events Not Accessible

Jul 13, 2011 at 12:01 PM


  I am using $().SPServices() to create events on a MOSS 2007 instance.  BTW, I am having the same problem when I skip SPServices and call the Ws in a console App.  It creates the events correctly until a new month begins, then when I click on the event, either in the All Events view or on the Calendar, I get

Exception Details: System.ArgumentException: Value does not fall within the expected range.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:

[ArgumentException: Value does not fall within the expected range.]
   Microsoft.SharePoint.SPContext.GetInstanceItem(Int32 id, String strId) +2544


Jul 13, 2011 at 12:18 PM


Given that you have the problem with or without SPServices, there must be some flaw in your underlying logic. It's really impossible for me to say, at least without seeing your code.


Jul 13, 2011 at 4:21 PM
Edited Jul 13, 2011 at 5:17 PM

RecurrenceData has translated < to &lt; > to &gt; and " to &quot;. but the code block here reconverted them.




$(function() {

            var $SaveItem = $("input[id*=diidIOSaveItem]");
            $ {
                var eventDate = "2011-07-12";
                var endDate = "2011-07-12";
                var subject = "July 12 For 8 Days";
                var reservedBy = "1";
                var resource = "2";
                var fAllDayEvent = "1";
                var fRecurrence = "1";
                var eventType = "1";
                var timeZone = "-1";
                var divId = "divId";
                var guid = generateGuid();
                guid = "{" + guid.toLowerCase() + "}";
                var recurrenceData = "<recurrence><rule><firstDayOfWeek>su</firstDayOfWeek><repeat><weekly th="TRUE" weekFrequency="1" /></repeat><repeatInstances>8</repeatInstances></rule></recurrence>";
                var now = new Date();
                    operation: "UpdateListItems",
                    async: false,
                    debug: true,
                    listName: "RERList20110713",
                    batchCmd: "Update",
                    valuepairs: [["TimeZone", timeZone], ["EventType", eventType], ["UID", guid], ["fRecurrence", fRecurrence], ["fAllDayEvent", fAllDayEvent], ["Title", subject], ["EventDate", eventDate], ["EndDate", endDate], ["ReservedBy", reservedBy], ["RecurrenceData", recurrenceData]],
                    completefunc: function(xData, Status) {
                        var out = $().SPServices.SPDebugXMLHttpResult({
                            node: xData.responseXML,
                            outputId: "divId"
                        $("divId").html("").append("This is the output from the UpdateListItems operation:" + out);
                        $("divId").append("Refresh to see the change in the list above.");


                return false;
Jul 13, 2011 at 4:53 PM

Great. I'm not sure I understand what the problem was, but glad it's solved by v0.6.2.


Jul 13, 2011 at 5:19 PM

The above code creates events that only work in the month the first event is created.  When the event goes to August then I receive

Exception Details: System.ArgumentException: Value does not fall within the expected range.

Jul 13, 2011 at 5:21 PM

Then you probably have some sort of error in your recurrence data. I'm not sure exactly how that works.