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