Add row according to given ID - InfoPath Dev
in

InfoPath Dev

Add row according to given ID

Last post 05-31-2010 06:58 AM by kaiowas. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-19-2010 08:38 AM

    Add row according to given ID

     Hi everyone!

     

    This is my first post here!

    I'm a total newbie in C# and infopath in general. I've a lot of experience in MATLAB programming as is my main tool for work.

    However, I'm doing some quotation forms for my company and need some help. I've research and haven't found anything that helps me with this issue.

    I need to make a form for sound systems and light automation quotations, and this is done in excel so far, but i want to minimize the human error involved in it. This quotations are made by "zones" (living room, main bedroom, kitchen, backyard, etc), and each zone has some items (amplifier, controller, keypad, speakers, etc), so according to the needs of the zone, the items quantity and the items themself vary. I've an access database with all the products that we work with (brand, series, reference, dealer price, selling price, weight, link to an image of the product).

     

    The idea is to add a repeating section that would be the zones and inside of that, I need a repeating table for the items. For example:

     

    Bedroom

     Speakers

    Amplifier

    Source

    Backyard

    Speakers

    Amplifier

    Remote Control

    Source

     

     Because I've read that passing arguments between infopath is kind of complicated, so I designed a query database form that searches the item you're looking form and gives you the ID of it. So, the idea is that in this quotation form, I could input the ID of the item , press a button and then it will add it to the item section of the active zone. I also tried including the ID query inside the repeating table, but it tells me that the item won't repeating itself, and guess what? it doesn't = S. It gives me the same result as the button approach, if I add a new row and modify the ID query of the new row, it just delete the new row and replace the first one with the ID I want. Same thing happens with the button approach (the ID query and "add item" button outside the repeating table.

    I don't know what extra info you need in order to help me, maybe the infopath forms files?

     

    Thanks in advance from Colombia!

     

    ASM

     

    PD: I've tried some of the code given in this forum, but haven't had any luck at all. Usually tells me that "XDocument" does not have this or that method, etc. I've also tried replacing XDocument with this or thisXDocument and no luck.

  • 05-19-2010 10:55 PM In reply to

    Re: Add row according to given ID

    Hi ASM,

    Your query needs to return multiple values when you configure the data connection so that InfoPath can correctly infer the schema as a repeating section. That should solve your problem. Go into Tools->Data Connections and modify the existing query. Make sure that the sample values results in *multiple return values* and then the secondary data source schema should be correctly inferred.

    Input parameters are not that hard. Qdabra's qRules makes it way easier. Check out the free trial from Qdabra's main site (note: Qdabra pays for this free forum).

    Patrick Halstead
    Project Manager at Qdabra
  • 05-31-2010 06:58 AM In reply to

    Re: Add row according to given ID

    Thanks for your reply Patrick!

    I had a very complicated week and couldn't check this out. Anyhow, I've managed to add the info of the row according to the ID with lots of filters and it is working nicely. However, I'm trying to incorporate a database query view so you can select the item to add or at least check the ID to add it manually on the table.

     With the database template from infopath I was able to do it in a breeze, but from this I haven't. I have three lists which are being populated by a secondary database (third in this case: fields, main database and sec database). This is working fine, and they interact between them nicely. The thing I cannot query the main database and get proper results.

    In the database template was easy because there was a difference between query and data fields, but how do i tell the query action that I want the query to be based on the lists (brand, series and reference)? I've tried querying the main database, querying the second database (which is stupid, but i tried anyway) , with repeating tables directly from the database, with repeating tables and trying to add filters, but nothing.

     

    If I try to add it directly binded to the database, then the repeating table shows every single record on the DB. If I try to add filters, I only get  the first result on the repeating table. You're mentioning that I can specify how many results are allowed, how do I do that? or is there a way for filtering the results directly binded to the DB?

     

    Thanks in adnvace!

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