Update a specified SharePoint List Item via code - InfoPath Dev
in

InfoPath Dev

Update a specified SharePoint List Item via code

Last post 03-24-2014 07:50 PM by Ruskin11. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-20-2014 08:29 PM

    Update a specified SharePoint List Item via code

    Hi all,

    In the infopath form I am designing, I have enabled the form to submit the data to a custom list via web services and then submit the form to the form library.

    What happens next is the next user will be notified via email and will update the next section of the form and again, once he hits submit the form will submit to the list and save the form back to the form library

    The issue that I am having is that the form will submit replica pieces of data to the list because I don't know how to get the form to find the corresponding item in the list and update it.

    Does anyone know if this is possible or could guide me in achieving this for my form?

    I have added the code for the initial submit using C# and my form is an infopath filler form.

    Thanks in advance,

    R

  • 03-24-2014 07:50 PM In reply to

    Re: Update a specified SharePoint List Item via code

    The following is some sample code which I am using to add to the item

    string ListName = root.SelectSingleNode("/my:myFields/my:ListName", NamespaceManager).Value;

    string taskNumberStage = root.SelectSingleNode("/my:myFields/my:TaskNumberStage", NamespaceManager).Value;

    string groupTaskNumber = root.SelectSingleNode("/my:myFields/my:GroupTaskNumber", NamespaceManager).Value;

    XPathNavigator batch = DataSources["Submit"].CreateNavigator()

    batch.SelectSingleNode(

    "/Batch/Method/Field[@Name='TaskNumberStage']", NamespaceManager).SetValue(taskNumberStage);

    batch.SelectSingleNode(

    "/Batch/Method/Field[@Name='GroupTaskNumber']", NamespaceManager).SetValue(groupTaskNumber);

    batch.SelectSingleNode(

    "/Batch/Method/Field[@Name='TaskTitle']", NamespaceManager).SetValue(taskTitle);

    DataConnections["Web Service Submit"].Execute();

    I attempt to use the same thinking that it will add to the xml document, which it does and thinking in turn it should update the SharePoint List.

    But unfortunately its not doing that, I'm missing a key part but I don't know what it is, can anyone help please?

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