GetListItems help - InfoPath Dev
in

InfoPath Dev

GetListItems help

Last post 05-24-2007 05:04 PM by shaun.nieves. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 12-29-2006 11:24 AM

    GetListItems help

    I'm having problems with the getlistitems webservice. I followed the tutorial and got the list and view id, but I can't locate the <fieldRef> id as the field I want to retrieve is a calculated column and not in the xsf file. I tried entering in the name of the field into the s0:viewFields value but I get the following error.


    The SOAP response indicates that an error occurred on the server:

    Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown.
    <detail>
    <errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">Element <ViewFields> of parameter viewFields is missing or invalid.</errorstring>
    <errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x82000000</errorcode>
    </detail>


    Does anyone know an alternate way to obtain the GUID of the column?
    Shaun Nieves
    Sharepoint Manager
  • 01-04-2007 10:07 AM In reply to

    Does anyone have an idea?
    Shaun Nieves
    Sharepoint Manager
  • 02-02-2007 04:12 AM In reply to

    Can you introduce some code examples ???
    Best regards,
    Alexander Ekzarov
    Kyiv, Ukraine
    silverlightnet.blogspot.com
  • 04-17-2007 06:05 AM In reply to

    Hi shaun.nieves,

     You mentioned that the column that you want to retrieve the GUID of a column, and is not in the xsf file. GUID's will be generate for only the promoted fields. If the field that you are retrieving the GUID is not promoted field will get the error, because you are forcing to get the GUID of a field that is not in the promoted list.

     please let me know if there is another problem you are getting.

    B.Shiva Prasad
    InfoPath Dev,
    http://www.ggktech.com
    India
  • 04-17-2007 11:42 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Hi Shaun,

    In this below article "Create InfoPath solution:" had 5 to 7 steps about how to add promoted properties in InfoPath form. After adding this column you need to check this column is available or not in SharePoint columns.

    http://www.infopathdev.com/blogs/agni/archive/2006/05/15/Query-for-Items-in-SharePoint-Form-Library-Using-GetListItems-Web-Method.aspx

    Follow this steps to get the GUID:

    1. Open the manifest.xsf of the solution in a text editor (be careful that you do not make any changes to the manifest.xsf file).
    2. Look for the list properties node:

    <xsf:listProperties>

        <xsf:fields>

            <xsf:field name="SearchValue"  columnName="{14A5521A-CE31-4DBC-924F-937E7A4288B8}" node="/my:myFields/my:SearchValue" type="xsd:string">

            </xsf:field>
        </xsf:fields>
    </xsf:listProperties>

    1. Copy the GUID of the promoted field in the brackets "{}".
  • 05-24-2007 05:04 PM In reply to

    Ok, instead of using the data connection, I decided on using code to grab the data I needed using the getlistitems webservice. Here is my code:

    Dim listService As New GetList.Lists

    Dim cr As New System.Net.NetworkCredential("", "", "")

    listService.Credentials = cr

    listService.Url = ""

    Dim xmlDoc As New System.Xml.XmlDocument

    Dim listName As String = "{9D39C54C-ABBB-4E79-A3DA-A781ADB09DF3}"

    Dim viewName As String = ""

    Dim rowLimit As String = ""

    Dim Unit As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:Unit").text

    Dim i As Integer

    listService As New GetList.Lists

    Dim cr As New System.Net.NetworkCredential("", "", "")

    listService.Credentials = cr

    listService.Url = ""

    Dim xmlDoc As New System.Xml.XmlDocument

    Dim listName As String = "{9D39C54C-ABBB-4E79-A3DA-A781ADB09DF3}"

    Dim viewName As String = ""

    Dim rowLimit As String = ""

    Dim Unit As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:Unit").text

    Dim i As Integer

    Dim cr As New System.Net.NetworkCredential("", "", "")

    listService.Credentials = cr

    listService.Url = ""

    Dim xmlDoc As New System.Xml.XmlDocument

    Dim listName As String = "{9D39C54C-ABBB-4E79-A3DA-A781ADB09DF3}"

    Dim viewName As String = ""

    Dim rowLimit As String = ""

    Dim Unit As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:Unit").text

    Dim i As Integer

    Dim xmlDoc As New System.Xml.XmlDocument

    Dim listName As String = "{9D39C54C-ABBB-4E79-A3DA-A781ADB09DF3}"

    Dim viewName As String = ""

    Dim rowLimit As String = ""

    Dim Unit As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:Unit").text

    Dim i As Integer

    Dim listName As String = "{9D39C54C-ABBB-4E79-A3DA-A781ADB09DF3}"

    Dim viewName As String = ""

    Dim rowLimit As String = ""

    Dim Unit As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:Unit").text

    Dim i As Integer

    Dim viewName As String = ""

    Dim rowLimit As String = ""

    Dim Unit As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:Unit").text

    Dim i As Integer

    Dim rowLimit As String = ""

    Dim Unit As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:Unit").text

    Dim i As Integer

    Dim Unit As String = thisXDocument.DOM.selectSingleNode("/my:myFields/my:Unit").text

    Dim i As Integer

    Dim i As Integer

    Dim query As System.Xml.XmlElement = xmlDoc.CreateElement("Query")

    Dim viewFields As System.Xml.XmlElement = xmlDoc.CreateElement("ViewFields")

    Dim queryOptions As System.Xml.XmlElement = xmlDoc.CreateElement("QueryOptions")

    Dim query As System.Xml.XmlElement = xmlDoc.CreateElement("Query")

    Dim viewFields As System.Xml.XmlElement = xmlDoc.CreateElement("ViewFields")

    Dim queryOptions As System.Xml.XmlElement = xmlDoc.CreateElement("QueryOptions")

    Dim viewFields As System.Xml.XmlElement = xmlDoc.CreateElement("ViewFields")

    Dim queryOptions As System.Xml.XmlElement = xmlDoc.CreateElement("QueryOptions")

    Dim queryOptions As System.Xml.XmlElement = xmlDoc.CreateElement("QueryOptions")

    query.InnerXml = "<Where><And><Eq><FieldRef Name=""ContainerType"" />" + "<Value Type=""Text"">CM</Value></Eq><Eq><FieldRef Name=""Unit"" />" + _

    "<Value Type=""Text"">" + Unit + "</Value></Eq></And></Where>"

    'query.InnerXml = ""

    'query.InnerXml = ""

    viewFields.InnerXml = "<FieldRef Name=""TrackingNumber"" /><FieldRef Name=""Unit"" /><FieldRef Name=""ContainerType"" /><FieldRef Name=""Active"" />"

    queryOptions.InnerXml = ""

    Dim nodeListItems As System.Xml.XmlNode = listService.GetListItems(listName, viewName, query, viewFields, rowLimit, queryOptions)

    MsgBox(nodeListItems.OuterXml, MsgBoxStyle.Critical)

     The data returned looks like this

     XML

    What I can't figure out is how to grab that data and put it into a repeating table. If anyone has an example. I would greatly appreciate it. Thanks!

     

    Shaun Nieves
    Sharepoint Manager
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.