{"id":491,"date":"2016-03-04T16:49:30","date_gmt":"2016-03-04T21:49:30","guid":{"rendered":"http:\/\/markwheeler.com\/wordpress\/?p=491"},"modified":"2016-03-04T16:49:30","modified_gmt":"2016-03-04T21:49:30","slug":"infopath-delete-item-via-updatelistitems-web-service","status":"publish","type":"post","link":"https:\/\/www.markwheeler.com\/?p=491","title":{"rendered":"InfoPath &#8211; Delete Item via UpdateListItems Web Service"},"content":{"rendered":"<p>I have been having problems sending a delete request via the lists.asmx web service in SharePoint.<br \/>\nMy Delete XML packet looks like this:<\/p>\n<pre>\n<Batch OnError=\"Continue\" PreCalc=\"TRUE\" ListVersion=\"0\">\n<Method ID=\"1\" Cmd=\"Delete\">\n<Field Name=\"ID\"><\/Field>\n<\/Method>\n<\/Batch>\n<\/pre>\n<p>Using the steps found here (<a href=\"http:\/\/jaliyaudagedara.blogspot.com\/2011\/03\/submitting-data-to-sharepoint-2010-list.html\">http:\/\/jaliyaudagedara.blogspot.com\/2011\/03\/submitting-data-to-sharepoint-2010-list.html<\/a>) I setup a Delete List Item data connection.<\/p>\n<p>When trying to delete an item from a list (not document library) I was seeing the following error in the<br \/>\nULS logs:<\/p>\n<pre>\nThe form definition (.xsf) file has an invalid mapping from the document to the submit web service\n<\/pre>\n<p>After a little digging it appears the web service call wants the list item ID to be an integer.<br \/>\nAfter exporting my template files, I edited the schema definition file (.XSD) for the Delete function.<br \/>\nAt the bottom of this file you will find:<\/p>\n<pre>\n\t<xsd:attribute name=\"PreCalc\" type=\"xsd:string\"><\/xsd:attribute>\n\t<xsd:attribute name=\"Cmd\" type=\"xsd:string\"><\/xsd:attribute>\n\t<xsd:attribute name=\"ListVersion\" type=\"xsd:string\"><\/xsd:attribute>\n\t<xsd:attribute name=\"OnError\" type=\"xsd:string\"><\/xsd:attribute>\n\t<xsd:attribute name=\"ID\" type=\"xsd:string\"><\/xsd:attribute>\n\t<xsd:attribute name=\"Name\" type=\"xsd:string\"><\/xsd:attribute>\n<\/pre>\n<p>Simply change:<\/p>\n<pre>\n\t<xsd:attribute name=\"ID\" type=\"xsd:string\"><\/xsd:attribute>\n<\/pre>\n<p>to<\/p>\n<pre>\n\t<xsd:attribute name=\"ID\" type=\"xsd:integer\"><\/xsd:attribute>\n<\/pre>\n<p>and my delete function works!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been having problems sending a delete request via the lists.asmx web service in SharePoint. My Delete XML packet looks like this: 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 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[10],"tags":[58,99],"class_list":["post-491","post","type-post","status-publish","format-standard","hentry","category-sharepoint","tag-infopath","tag-sharepoint-2010"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=\/wp\/v2\/posts\/491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=491"}],"version-history":[{"count":0,"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=\/wp\/v2\/posts\/491\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}