I am using Sharepoint 2010 for my document library, method used to communicate with sharepoint is through webservice as sharepoint is installed in a separate machine. When I add in my library, I will need to update on some of the additional columns. I have no issue uploading the file, but when I want to update the columns, I will need the ID.
I uploaded 2 different files, but when I use my query, I will always see both the file. This is the query I used.
Dim objXMLDoc As XmlDocument = New XmlDocument()
Dim objXmlQuery As XmlElement = objXMLDoc.CreateElement("Query")
Dim objXmlView As XmlElement = objXMLDoc.CreateElement("ViewFields")
Dim objXmlOptions As XmlElement = objXMLDoc.CreateElement("QueryOptions")
objXmlQuery.InnerXml = "<orderby><FieldRef Name='Created' Ascending='FALSE'/></orderby><where><eq><fieldref Name='FileLeafRef'/><value type='text'>" + strFileName + "</value></eq></where>"
objXmlView.InnerXml = "<fieldref Name='ID'/>"
objXmlOptions.InnerXml = "<ViewAttributes Scope='Recursive' />"
Dim objXmlListItem As XmlNode = spProxy.GetListItems("DocLibName","DocLibView", objXmlQuery, objXmlView, "", objXmlOptions, vbNullString)
Can someone guide me on this?
I found the issue, it is due to the order by statement, anyway that I can include the order by statement in the CAML?