UpdateListItem on a Form Library - InfoPath Dev
in

InfoPath Dev

UpdateListItem on a Form Library

Last post 08-14-2008 05:46 AM by mjaneczk. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-13-2008 12:11 PM

    • mjaneczk
    • Top 500 Contributor
      Male
    • Joined on 02-18-2008
    • Dearborn, MI
    • Posts 35

    UpdateListItem on a Form Library

    This is probably teh last hurdle I have to overcome to finish my project, so I am anxious, especially since I have come this far. 

    I have a form library from which I read all the columns into a repeating table.  The user will select, via checkbox, which ones he wants to process.  Upon clickign a button, I use some C# code to process all the records in that table.  No problem, there.  Now, I need to update one of the columns in hte underlying form library, markign the record as "done". 

    I have searched a whole bunch on the UpdateListItem web service.  The CAML I ome up with is:

    <Method ID="1" Cmd="Update"><Field Name="ID">3</Field><Field Name="FileRef">[MYURL1]</Field><Field Name="Status">done</Field></Method>

    The code I use is like this:

    /*Declare and initialize a variable for the Lists Web service.*/

    sitesWebServiceLists.Lists listServiceU = new sitesWebServiceLists.Lists();

    //Authenticate the current user by passing their default

    //credentials to the Web service from the system credential cache.

    listServiceU.Credentials = System.Net.CredentialCache.DefaultCredentials; listServiceU.Url = "[MYURL2]/_vti_bin/lists.asmx";

    sRequestGUID = "Requests";

    XmlNode ndReturn1 = listServiceU.UpdateListItems(sRequestGUID, elBatchUpdate);if (ndReturn1.FirstChild.FirstChild.InnerText != "0x00000000")

    {

    thisXDocument.UI.Alert("Error Occurred: " + ndReturn1.FirstChild.FirstChild.InnerText);

    continue;

    }

    NOTE: I have disguised the URLs with [MY URLX]   MYURL1 is the URL to the document I am updating.  MYURL2, appended with "_vti_bin/lists.asmx" points to the web service. 

    I have tried using teh name and GUID for the form library name.  I can cut and paste the URL for the web service into a borwser and the web service page comes up.  The URL in my CAML brings up teh correct document.  Yet it throws the error HTTP 404 Not Found.  What am I doing wrong?

    Mike Janeczko
    Ford Motor Company
  • 08-14-2008 05:46 AM In reply to

    • mjaneczk
    • Top 500 Contributor
      Male
    • Joined on 02-18-2008
    • Dearborn, MI
    • Posts 35

    Re: UpdateListItem on a Form Library

    Anyone?

    Mike Janeczko
    Ford Motor Company
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.