views:

406

answers:

2

I got this code in VB. and it doesn't do anything.Can anyone help me under stand why and give me a solution?

Dim updatestr As String = "<Method ID='1' Cmd='Update'>" + _
            "<Field Name='Title'>Ficha_router</Field>" + _
            "<Field Name='ID_Cliente'>0000</Field>" + _
            "</Method>"


            Dim xmlDoc = New System.Xml.XmlDocument()

            Dim elBatch As System.Xml.XmlElement = xmlDoc.CreateElement("Batch")

            elBatch.SetAttribute("OnError", "Continue")
            elBatch.SetAttribute("ListVersion", "1")
            elBatch.SetAttribute("ViewName", "")

            elBatch.InnerXml = updatestr

            listService.UpdateListItems("Flecha", elBatch)
A: 

You may need to add <Field Name='ID'>9</Field> in order for the webservice to determine which item requires updating.

http://msdn.microsoft.com/en-us/library/cc404818.aspx

Nat
The problem is that I'm trying to update certain required fields in a determined file I've just uploaded to the library. When I then refresh the library, the file shows up (I also have a routine to check in the file, in place) but nothing happens to the fields I require to update.
v3ga
A: 

I've solved it.

I'm retrieving the item "ID" field thru the web service, and then I update it. I just thought that the updatelistitems could find my file without me knowing the ID.

Thanks anyway.

v3ga
Yeah, that requirement is not the best.
Nat