How to add item(s) to 2 Sharepoint Lists? - InfoPath Dev
in

InfoPath Dev

How to add item(s) to 2 Sharepoint Lists?

Last post 08-18-2012 02:16 AM by Gennady Vanin (Геннадий Ванин, Новосибирск). 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-17-2012 08:53 AM

    How to add item(s) to 2 Sharepoint Lists?

    On Submit I need not only to add an item to the Library but also to add one item to the List1 and multiple items to the List2
    I use 2 CAMLs and 2 web service connections (having 2 fields on the form with lists' GUIDs). Something like this -

    Dim batch1 As XPathNavigator = DataSources("CamlAddToItemDetails").CreateNavigator()batch1.SelectSingleNode("/Batch/Method/Field[@Name='ItemId']", NamespaceManager).SetValue(ItemId)batch1.SelectSingleNode("/Batch/Method/Field[@Name='Commodity']", NamespaceManager).SetValue(Commod)DataConnections("WebServiceSubmitToItemDetails").Execute() ‘Loop to Add multiple rows to the second list While (condition)'Get vars step, stepOrder, etcDim batch2 As XPathNavigator = DataSources("CamlAddToItemSteps").CreateNavigator()batch2.SelectSingleNode("/Batch/Method/Field[@Name='ItemId']", NamespaceManager).SetValue(ItemId)batch2.SelectSingleNode("/Batch/Method/Field[@Name='Step']", NamespaceManager).SetValue(step)batch2.SelectSingleNode("/Batch/Method/Field[@Name='StepOrder']", NamespaceManager).SetValue(stepOrder) MessageBox.Show(vars to add) DataConnections("WebServiceSubmitToItemSteps").Execute()End While

    Items in the first list are created with no problem and the second CAML fails to add but I don't get any error messages. What could that be? 

  • 08-18-2012 02:16 AM In reply to

    Re: How to add item(s) to 2 Sharepoint Lists?

    esb1922:
    On Submit I need not only to add an item to the Library but also to add one item to the List1 and multiple items to the List2
    I use 2 CAMLs and 2 web service connections (having 2 fields on the form with lists' GUIDs). Something like this -

    Dim batch1 As XPathNavigator = DataSources("CamlAddToItemDetails").CreateNavigator()batch1.SelectSingleNode("/Batch/Method/Field[@Name='ItemId']", NamespaceManager).SetValue(ItemId)batch1.SelectSingleNode("/Batch/Method/Field[@Name='Commodity']", NamespaceManager).SetValue(Commod)DataConnections("WebServiceSubmitToItemDetails").Execute() ‘Loop to Add multiple rows to the second list While (condition)'Get vars step, stepOrder, etcDim batch2 As XPathNavigator = DataSources("CamlAddToItemSteps").CreateNavigator()batch2.SelectSingleNode("/Batch/Method/Field[@Name='ItemId']", NamespaceManager).SetValue(ItemId)batch2.SelectSingleNode("/Batch/Method/Field[@Name='Step']", NamespaceManager).SetValue(step)batch2.SelectSingleNode("/Batch/Method/Field[@Name='StepOrder']", NamespaceManager).SetValue(stepOrder) MessageBox.Show(vars to add) DataConnections("WebServiceSubmitToItemSteps").Execute()End While

     

    Items in the first list are created with no problem and the second CAML fails to add but I don't get any error messages. What could that be?

     

    You have 2 webservice connections but execute in code only one...

     

    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.