Hi everyone,
I am new to both InfoPath and SharePoint so I appreciate any help you can give. Through the use of other sources, I have put together a form which will create List Items (really events in a Calendar List) in SharePoint programmatically. Using CAML, the UpdateListItems method and some VBScript, the form creates items just fine.
The issue is this: I would like to modify my form so that it will overwrite the List Item/Event if the same title is being input. How would I go about doing this? Can the CAML be modified to overwrite if a duplicate is found?
I appreciate any help you can give. Here is my code thus far:
CAML Script:
<?xml version="1.0" encoding="UTF-8" ?>
<Batch>
<Method ID="1" Cmd="New">
<Field Name="Title" />
<Field Name="Location" />
<Field Name="Description" />
<Field Name="EventDate" />
<Field Name="EndDate" />
<Field Name="ProjectManager" />
<Field Name="ProjectSponsor" />
<Field Name="DIPhase" />
<Field Name="ProjectName" />
</Method>
</Batch>
The basics of my code:
Dim batch
Set batch = XDocument.DataObjects("EventCAML").DOM
batch.selectSingleNode("/Batch/Method/Field[@Name='Title']").text = ProjectName
XDocument.DataAdapters("Submit").Submit