Insert command: Not adding rows - no error message. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Insert command: Not adding rows - no error message.

Last post 08-14-2009 08:06 AM by Sam Camblin. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 08-13-2009 11:09 AM

    Insert command: Not adding rows - no error message.

    Hi,

    I'm new to InfoPath and just installed qRules.  I'm trying to use the Insert command to add a new row to a table when a button is clicked.  I followed your instructions and example xsn file to create the below example.  When I click on the button it doesn't add a row or give an error message.  Thoughts? 

     

    Button's action:   Set a field's value: Command = "Insert/parent = /my:myFields/my:Table/ child = /my:RepeatingInsert/count = 1"

     

    My data source looks like this:

     

    myFields

         Table

                RepeatingInsert

                             ID

                             Name

                             Description

                DetailID

    Filed under: ,
  • 08-13-2009 11:25 AM In reply to

    Re: Insert command: Not adding rows - no error message.

    Hi -- your command looks like it might have some spacing issues.

    Insert /parent =/my:myFields/my:Table /child =/my:RepeatingInsert /count = 1

    There should be a '/' before each of the arguments like parent, child and count.

    Hilary Stoupa

  • 08-13-2009 12:34 PM In reply to

    Re: Insert command: Not adding rows - no error message.

    Hi Hilary,

    Thanks for your quick response.  I pasted what you provided and verified the formula and it says: "Insert/parent" does not point to a valid location path of a field or group. 

    I tried the Copy XPath to make sure I got it right, but I'm still getting the same message.  Below is what I'm using with the copy XPath and the spacing you suggested.  Thoughts?

     Insert /parent=/my:myFields/my:Recommendations /child=/my:myFields/my:Recommendations/my:Table /count=1

     

  • 08-13-2009 12:52 PM In reply to

    Re: Insert command: Not adding rows - no error message.

    Don't click the fx button to open the formula editor, simply paste into the Value text box.

    Hilary Stoupa

  • 08-14-2009 05:55 AM In reply to

    Re: Insert command: Not adding rows - no error message.

    Hi Hilary,

    I tried both ways.  I currently have it pasted into the Value text box.  Attached is the file.  Thoughts?

  • 08-14-2009 06:18 AM In reply to

    Re: Insert command: Not adding rows - no error message.

    Hi Sam, I see two problems:

    1. /child is a relative path, so it should be /my:Table.

    2. qRules cannot coexist with code. It looks like this form has code. Can you confirm?

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


  • 08-14-2009 07:37 AM In reply to

    Re: Insert command: Not adding rows - no error message.

    Hi ErnestoM,

     

    Thank you for your quick response!

    1. I've changed the child path per your suggestion on the attached form, but it's still not working. Here is what I used: Insert /parent=/my:myFields/my:Recommendations /child=/my:Table /count=1 (see attached).
    2. I didn't think I added code. I just added a "detail" button using the existing controls in InfoPath (see below). Is this considered adding code?

     

    Detail Button:

    The "detail" button on the repeating table switches to the detail view displaying repeating section with controls.  This is similar to Matt Faus blog (below).  The only difference is my form uses a repeating table instead of a Matt's master/detail control.  

     

    The Detail button actions are:

    • Set a field's value: DetailID = Number
    • Switch to view: Detail

     

    Matt Faus's blog is:

    http://www.infopathdev.com/blogs/matt/archive/2006/01/09/Create-a-Multi_2D00_View-Master_2F00_Detail-using-an-InfoPath-Data-Filter.aspx

  • 08-14-2009 07:51 AM In reply to

    Re: Insert command: Not adding rows - no error message.

    This form does have its own code module -- and the manifest.xsf file is using it instead of the qRules dll. You need to go to Tools / Form Options / Programming and select the 'Remove Code' button to delete the association to the code file. Save and close the form, then re-inject with qRules.

    It is really easy to accidentally add an event handler, no doubt that's what happened in your case...

    Hilary Stoupa

  • 08-14-2009 07:55 AM In reply to

    Re: Insert command: Not adding rows - no error message.

    Hi Sam,

    Perhaps it was accidental. When I preview the form it tells me that it cannot find the source code. Also, if I go to Tools > Form Options > Programming, I see the project location for code: C:\Documents and Settings\sbcamb\My Documents\InfoPath Projects\Add Recommendations Test\Trial - Master Detail.vbproj. I'm guessing that qRules doesn't like this (can't coexist with code) - that's why you don't even get an error message popup.

    Anyway, I figured out a way to fix this without having to recreate the form.

    1. Go to Tools > Form Options > Programming and remove the code.

    2. Save the form template

    3. Reinject qRules.

    4. Preview, try it, it works!

    EDIT: Hilary, you're too quick for me.

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


  • 08-14-2009 08:06 AM In reply to

    Re: Insert command: Not adding rows - no error message.

    Hilary & ErnestoM,

    Its working now.  Thank you so much!   

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