Pass item ID of selected item in list view to newly open InfoPath form - InfoPath Dev
in

InfoPath Dev

Pass item ID of selected item in list view to newly open InfoPath form

Last post 01-12-2011 07:50 PM by prakash. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-11-2011 08:26 PM

    Pass item ID of selected item in list view to newly open InfoPath form

     

    Hi

    I have a library where two InfoPath content types(QualityReportForm and QualityCommentForm) are published. Basically, the library should display reports and its related comments by grouping them as shown in the fig1. Both of the content types derive from the one parent content type which has a field GUID. I have a workflow, which sets this GUID field by the Name of the report for QualityReportForm. In case of QualityCommentForm, I have a dropdownlist (please see fig2) which user select to choose the report name so that I can set GUID by the selected value of this dropdownlist.

    fig1: Library with two content type alt text

     fig2: Comment form

     alt text

    Now, I want to set the report name in the comment form automatically depending on which report is checked in the list (Please see fig1, there Report5 is checked). Let's suppose, we first check the Report5 as shown in fig1 in the list view. Click on the New Document and then on QualityCommentForm. When the new Comment form is open, it should automatically set Report5.xml in the dropdownlist.

    Basically, this requires passing the ID or Name of the selected item(in our case, report5.xml) to the newly opened infopath form. Can this functionality be achieved in InfoPath 2010?

    Thanks

    Prakash

  • 01-11-2011 09:56 PM In reply to

    Re: Pass item ID of selected item in list view to newly open InfoPath form

    That checkbox is for the contextual ribbon - it may require some custom code to take that focus and pass it as a parameter to your form the way you're asking.  However, there are much more direct built-in methods of doing what you're trying to accomplish.  The first thing is that I don't think the comments should be an entire form saved in the same form library.  That's totally up to you, but there is nothing about the comments form that requires InfoPath, or at least it doesn't require a full form library template.  What I would suggest trying (if you aren't tied to your current solution) is this:

    • Keep the first form as-is
    • Create a custom list for the comments, convert the list to InfoPath, and add an InfoPath form web part to the bottom of the page from Fig1 (or to the right if you prefer)
    • In the custom list, either create a lookup column back to the form library, or create a receive data connection and connect it to a dropdown field in the custom list form (bound to a regular text field)
    • Then, connect the web parts by choosing "Send Row of Data to," then "Get Data From," then match the two fields.  The key will be that when you configure your dropdown in the custom list, set the Value to ID and the Display Name to Title/Name or whatever you're using to reference the associated form.  Then, in the web part connection, be sure to pass the ID into the dropdown field.

    The result of the above is that your form library items will have double arrow icons on the left that you select to highlight that row (not the same as the checkbox you referenced), and when selected, that form's ID will be inserted into the comment form's dropdown for direct association.  Similarly, you could use this method to display all comments for a given form in ONE display form within an InfoPath form web part, which is very powerful and efficient.

  • 01-12-2011 07:50 PM In reply to

    Re: Pass item ID of selected item in list view to newly open InfoPath form

    I appreciate your solution very much but I have to approach my management team for approval of  this implementation.

    Thanks for your great suggestions.

    Prakash

     

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