Autofill Through SharePoint Data Connection - InfoPath Dev
in

InfoPath Dev

Autofill Through SharePoint Data Connection

Last post 01-14-2011 11:09 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-11-2011 12:16 PM

    Autofill Through SharePoint Data Connection

    Hello,

     I am new to InfoPath and am not familiar with code at all.  I have been teaching myself the functions I need to learn but seem to be at a standstill.  I have found other, similar forum posts but none have been able to help me solve my issue.

     I am using InfoPath 2010 and have designed a 2007 Compatible Web Form, and the form works perfectly except for one piece.

     As one of the main functions of the form, users can enter a part number into a repeating table, and 3 fields are populated automatically via a data connection to a Sharepoint list: Part Description, Unit of Measure (Price Unit), and Base Price.  Originally I had each line of the repeating table pull data from the Sharepoint list as users entered the part number, so that the user entered a part number and data was autofilled on the spot, before adding any more lines to the repeating table for more entries.  However, as the list that contains the part numbers on SharePoint is so massive, the query time when doing this made the form almost unuseable due to the time it took to populate each field.  My solution to this was to add a "Fill Data" button that would query for data only when the user clicked the button, and the form would then go out and pull descriptions based on the part numbers that the user had entered on each line of the repeating table.  This worked much better, however here is where the problem arose.  Instead of pulling data for each line, the form filled ALL part descriptions, UOM's, and Base Prices based upon the first line ONLY, so that the form contained multiple lines and different part numbers listed, but the same autofilled data for each part, despite the fact that each line contained different info.

     I need the form to pull data for each line correctly so that when the user clicks the 'Fill Data' button the correct data would fill for each lines' part number, not the same data for every line.  I know that I may need to use the current() function somehow, but my efforts in this regard have been futile.  One important thing to note is that the Fill Data button is not in the same group as the repeating table.

    Here is the XPath for the data query to get the Part Description, the other two queries are the same except for the end field (part description etc).  The query runs off of a rule that tells the form to query when the button is clicked and then set a fields value (ex:the 'part description field) based upon the query result.

    xdXDocument:GetDOM("Test 4k")/dfs:myFields/dfs:dataFields/dfs:Test_4k/@PART_DESCRIPTION[../@PART_ = xdXDocument:get-DOM()/my:myFields/my:group3/my:group4/my:zeepartnum]

    Any help would be GREAT - I am pulling my hair out over this!

     

    Thanks,

    Matt

     

  • 01-14-2011 10:03 AM In reply to

    Re: Autofill Through SharePoint Data Connection

    I'm sure this is doable in code, even though I'm not a programmer. Your code will probably need to iterate thru the list of codes and get the corresponding data from SharePoint, then copy those values to the main data source.

    A shortcut would be to filter data on the server using qRules. Here's a PDF with step by step to do this.

    Good luck!

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 01-14-2011 11:03 AM In reply to

    Re: Autofill Through SharePoint Data Connection

    Great tip, thanks Ernesto, I will take a look.

     

    A quick question on Qdabra - is the program required to use the form, or can I use the trial version to create the code with no ill effects on the form once the trial expires

     

    Thanks,

    Matt

  • 01-14-2011 11:09 AM In reply to

    Re: Autofill Through SharePoint Data Connection

    When the trial expires, qRules will stop working in your template. So if you were using qRules commands for logic in your form, those would cease to function. You can upgrade a form with the trial to the full version, however, and it will then continue to function correctly.
    Hilary Stoupa

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