Using a recommendation from Paul Schaeflein, http://www.schaeflein.net/blog/ , I am able to get the boolean fields from an InfoPath Form. Now my problem is writing the Event to an Event list. After rerading one of Todd Bleeker's post, I creeated a web application to add an Event Item to the list and I added code to set AllowUnsafeUpdates to True as shown below:
Dim site As SPSite = SPControl.GetContextSite(context)
Dim sWeb As SPWeb = site.AllWebs("/sites/Facilities")
Dim destList As SPList = site.AllWebs("/sites/Facilities").Lists("Current Facilities Schedule")
Dim listItems As SPListItemCollection = destList.Items
sWeb.AllowUnsafeUpdates = True
site.AllowUnsafeUpdates = True
Trace.Warn("site URL: " & site.Url)
Trace.Warn("sWeb URL: " & sWeb.Url)
Trace.Warn("site Get: " & site.AllowUnsafeUpdates)
Trace.Warn("sWeb Get: " & sWeb.AllowUnsafeUpdates)
Dim newItem As SPListItem = listItems.Add()
sBegin_date = "12/15/2005"
stitle = "Event Test #" & Now()
sEnd_Date = "12/16/2005"
sRoom_resource = "1735 Conference Room"
sActivity_Type = "Meeting"
newItem("ID") = -1
newItem("fRecurrence") = 0
newItem("Title") = stitle
newItem("Begin") = sBegin_date
newItem("End") = sEnd_Date newItem("Room Resource") = sRoom_resource
newItem("Activity Type") = sActivity_Type
newItem("Approval Status") = 2 'Pending
newItem.Update()
When I run the web app, I get the following error:
site URL: http://.......................... 0.046588 0.033287
sWeb URL: http://..................../sites/Facilities 0.066538 0.019949
site Get: True 0.066639 0.000102
sWeb Get: True 0.066675 0.000036
Unhandled Execution Error
Updates are currently disallowed on GET requests. To allow updates on a GET, set the 'AllowUnsafeUpdates' property on SPWeb.
at Microsoft.SharePoint.Library.a.a(String A_0, String A_1, Boolean A_2, Int32& A_3, String& A_4, String A_5, Object& A_6, Object& A_7)
at Microsoft.SharePoint.SPListItem.Update()
Any Ideas on how to fix the problem????