InfoPath – Delete Item via UpdateListItems Web Service

 Sharepoint  Comments Off on InfoPath – Delete Item via UpdateListItems Web Service
Mar 042016
 
Share

I have been having problems sending a delete request via the lists.asmx web service in SharePoint.
My Delete XML packet looks like this:

<Batch OnError="Continue" PreCalc="TRUE" ListVersion="0">
<Method ID="1" Cmd="Delete">
<Field Name="ID"></Field>
</Method>
</Batch>

Using the steps found here (http://jaliyaudagedara.blogspot.com/2011/03/submitting-data-to-sharepoint-2010-list.html) I setup a Delete List Item data connection.

When trying to delete an item from a list (not document library) I was seeing the following error in the
ULS logs:

The form definition (.xsf) file has an invalid mapping from the document to the submit web service

After a little digging it appears the web service call wants the list item ID to be an integer.
After exporting my template files, I edited the schema definition file (.XSD) for the Delete function.
At the bottom of this file you will find:

	<xsd:attribute name="PreCalc" type="xsd:string"></xsd:attribute>
	<xsd:attribute name="Cmd" type="xsd:string"></xsd:attribute>
	<xsd:attribute name="ListVersion" type="xsd:string"></xsd:attribute>
	<xsd:attribute name="OnError" type="xsd:string"></xsd:attribute>
	<xsd:attribute name="ID" type="xsd:string"></xsd:attribute>
	<xsd:attribute name="Name" type="xsd:string"></xsd:attribute>

Simply change:

	<xsd:attribute name="ID" type="xsd:string"></xsd:attribute>

to

	<xsd:attribute name="ID" type="xsd:integer"></xsd:attribute>

and my delete function works!

Filtering InfoPath drop-down list on previous, future selections

 Sharepoint, Software  Comments Off on Filtering InfoPath drop-down list on previous, future selections
Feb 252016
 
Share

Another requirement for my teleconference reservation form was to only allow one unique user to be assigned to a number.

I had to figure a way to filter or exclude previously selected users from other drop-down box selections.

My user drop-down is populated via the Attendees people picker field from the Main datasource.

DropDownRules4

I then created a filter on the Person group datafields to limit the drop-down options displayed.
The actual expression is:

not(pc:DisplayName = xdXDocument:getDom("ConferenceMaster")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:User)

DropDownRules

The resulting form looks like this; Only when Assign is clicked do the following drop-down boxes filter.

DropDownRules2

DropDownRules3

For reference, my Assign button rules are depicted here:

AssignRules