Custom button for adding a new row to a repeatable table - Infopath 2010 - InfoPath Dev
in

InfoPath Dev

Custom button for adding a new row to a repeatable table - Infopath 2010

Last post 05-19-2013 01:34 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-17-2013 10:50 AM

    Custom button for adding a new row to a repeatable table - Infopath 2010

    Hello, First post here, and I am a complete newb to Infopath as well as Visual Basic, although I have programming experience in many other languages. I would like to add a button to my InfoPath form (that I created using the Word -> Infopath convertion tool in Infopath 2010) that adds new rows to a repeatable table I have. I have tried a few solutions, but each of them gives me a plethura of errors from the vb code editor (built into Infopath). For example, I have tried adding a new row with the following line: XDocument.View.ExecuteAction("xCollection::insert", "group11_87") For this, I get "Name 'XDocument' is not declared"... I have also tried another solution that uses the following line: XPathNavigator myNav = this.MainDataSource.CreateNavigator().SelectSingleNode(xpath, NamespaceManager); This errors out with "'XPathNavigator' is a type and cannot be used as an expression", "Name 'myNav' is not declared", and other gems. I am used to programming mainly in Java, Python, C, and a few other languages that are not specific to Microsoft Windows... Basically anything I try and enter into the event handler (called when my button is clicked), I get a ton of error messages. Am I missing some required Import statement? Any help would be very much appreciated, as I would like to learn a lot more about custom development in InfoPath... Thank You!
  • 05-19-2013 01:34 PM In reply to

    Re: Custom button for adding a new row to a repeatable table - Infopath 2010

    Hi Araisbec and welcome!

    This is a relatively simple thing to do an there are lots of code snippets in this forum for doing this.

    Make sure you are selecting the namespace first before you attempt to add it.

    In fact, this request is so common that we included it in the qRules plugin that we offer - the command is called Insert.

    Qdabra Software pays for this forum and our goal is a response rate of 90%.

    However, we can't answer every specific coding request - it would take too much time and we'd go out of business. qRules plugin was meant to be the generic solution.

    So, several options for you:

    1. Search the forum more for posts on this
    2. Wait for someone else to respond with code snippet  
    3. Purchase a single support pack from Qdabra dot com and we'll help next week
    4. Install qRules free trial and use the Insert command (this can be done in <5 minutes)

    Best of luck!

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.