Delete specific row in repeating section - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Delete specific row in repeating section

Last post 11-22-2010 11:19 AM by asammyr. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-13-2010 01:39 PM

    Delete specific row in repeating section

    Hello.  I've designed an InfoPath 2007 form that querys a SQL Server database. The form displays a list of operating systems and operating system versions. I have a table called OperatingSystem and another table called OperatingSystemVersion that are linked by key.

     If I search for Windows, I get several results because of the one to many relationship with the versions (2000, XP, Vista, etc...)

    I understand that I could not delete Windows because there are several child records with keys that rely on that record, but how would I delete the child records (version) that appear on the form?  I would like to make a form button to delete a specific version. Idea was to put the delete button in the repeating section so it appears next to every record but I don't know programaticly how to specify to delete the record in the row where the button is clicked.

     

    Thanks for reading and any suggestions.

     

    Howard 

  • 09-20-2010 07:36 PM In reply to

    Re: Delete specific row in repeating section

    Hello Howard,

     qRules' Delete command can be used to delete any node in your form, including specific rows of a repeating table.  I recommend using this approach rather than writing code expressly for this purpose.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-22-2010 11:19 AM In reply to

    Re: Delete specific row in repeating section

    This is how I solved that problem. 

    1) First create a view called Delete Record.
    2) In the Delete Record View
        a) Place all the fields that you need to confirm that you are deleting the correct record on the form as text box that is read only.
        b) Place a button on the form that is set to Delete & Submit
        c) Place a button on the form that will switch the view back to the original view with the repeating table.
    3) In the View with the repeating table
        a) Create a column in the repeating table and add a botton with the following actions in a single rule.
            1) Set Field Value: [Unique ID from data] = [Unique ID from query]
            2) Query using data connection:Main Connection
            3) Switch View: Delete Record

    This will essentially query only for that one data item and switch you to the Delete Record view.  Then you can delete that item.

    Hope this helps!

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