Repeating Table from 2nd Data Source, every row with button, get current row - InfoPath Dev
in

InfoPath Dev

Repeating Table from 2nd Data Source, every row with button, get current row

Last post 08-23-2011 01:18 AM by samy08. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-22-2011 09:03 AM

    • samy08
    • Not Ranked
    • Joined on 07-26-2011
    • Posts 4

    Repeating Table from 2nd Data Source, every row with button, get current row

     Hello,

     I have googled now for hours and can't get this easy thing working.

    Basically I have SharePoint List and I want to kick-off a WorkFlow for a specific Item from InfoPath. This would be done via a WebService. I can call this WebService from Infopath (Data Connection), but it always uses the first Item-ID found. So I need to get the ItemID of the button clicked. (I added a button into the repeating table). But if I click the button it still just gets the Item-ID from the first row.

     Here is a screen of the Form:

     

    Would really appreciate any help!

  • 08-22-2011 11:00 AM In reply to

    Re: Repeating Table from 2nd Data Source, every row with button, get current row

    What's the rule on your button? Select the edit XPath checkbox in the formula editor before pasting it in, so we can see the full XPath....

    Hilary Stoupa

  • 08-23-2011 01:18 AM In reply to

    • samy08
    • Not Ranked
    • Joined on 07-26-2011
    • Posts 4

    Re: Repeating Table from 2nd Data Source, every row with button, get current row

     Sorry, definitely my fault. Forget to post it..

     I use the submit/code function with C#. I just tried to select the current ID (in which row the button is). Then I can call a WebService with this information.

     With that I try to select a field called ID, which is part of the repeating table.

     

    String x = e.Source.CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/dfs:RequestFL/@ID", NamespaceManager).Value;


     However always the first occurrence of the ID field is selected. I tried about ~20 different ways.

     With that code I just set the selected value to a textfield to check what was selected:

    XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();

    xnDoc.SelectSingleNode("/my:myFields/my:CurrentItemID", ns).SetValue("The following error occurred:" +x+ "bla");


     

    The WebService is definitely working. I managed to call it from Infopath. Here is an error message produced by SharePoint, due to that always the first occurence of the ID is selected.

     

    Form submission failed. (User: XXXXXXXXXXXXXX, Form Name: Cancel, IP: , Request: XXXXXXXXXXXXXXXXXXXXXX, Form ID: urn:schemas-microsoft-com:office:infopath:Cancel:-myXSD-2011-08-22T09-40-32, Type: DataAdapterException, Exception Message: The remote server returned an error: (500) Internal Server Error. Server was unable to process request. ---> The selected workflow 'XXXXXXXXXXX' is already running on list item with id 76 in list 'RequestFL' on siteXXXXXXXXXXXXXXXXXXXXX. The remote server returned an error: (500) Internal Server Error.) 
     

    I apologize for not posting this essential information in my first post.

     

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