Repeating Table copy previous record - InfoPath Dev Sign in | Join | Help in Code InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Code » Repeating Table copy previous record Repeating Table copy previous record Last post 08-23-2016 02:54 PM by TracyK. 35 replies. Page 1 of 3 (36 items) 1 2 3 Next > Sort Posts: Oldest to newest Newest to oldest Previous Next 06-12-2009 01:26 PM rconverse Joined on 06-03-2009 Posts 13 Repeating Table copy previous record Reply Contact Hello, Is there a way to have a repeating table copy the record prior to create the "new record"? If so and anyone could post code, I'd be very appreciative. Thank you, Roger 06-12-2009 03:53 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Repeating Table copy previous record Preceding-SiblingCopyDown.xsn Mark as Not AnswerMark as Answer... Reply Contact Hi -- so what you want is when you insert a new row in a repeating table, the new row has the same values as the previous row? You can use preceding-sibling for this, no code required. I've attached a sample to the header of this reply. Right click the link and select save as to save locally. Then, right click the local copy and select design. Preview the form to try. Hilary Stoupa 06-12-2009 04:49 PM In reply to rconverse Joined on 06-03-2009 Posts 13 Re: Repeating Table copy previous record Mark as Not AnswerMark as Answer... Reply Contact Exactly. Thanks! Do you think you could reccomend a good overall InfoPath book? 06-15-2009 04:31 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Repeating Table copy previous record Mark as Not AnswerMark as Answer... Reply Contact Patrick Halstead's book is fantastic, but I'm really hot on these labs right now, because I think the hands on experience is fantastic. While these are written with IP 2003 in mind, the basics hold true through 2007, though the code object model changes.... Hilary Stoupa 07-01-2009 02:13 PM In reply to harp71 Joined on 06-29-2009 Posts 15 Re: Repeating Table copy previous record Issue.xsn Mark as Not AnswerMark as Answer... Reply Contact Hilary, I have used this techniques successfully several times... and most recently have migrated it into another form where I have a repeating section with a field that I would like to autonumber... I cannot however seem to make this code work in this form... see attached simplified form Any ideas Note: I have another form where this exact same code is working just fine in a repeating section... 07-10-2009 02:50 PM In reply to rconverse Joined on 06-03-2009 Posts 13 Re: Repeating Table copy previous record Mark as Not AnswerMark as Answer... Reply Contact I was able to install that function, no problem. The problem is, I thought that if someone keyed over the copied line above it, when submitted it wouldn't revert back to copying the line above it. Is there a way to keep the functionality of copying the above row when you create a new one, but if someone keys something it "sticks"? Thanks,Roger 07-10-2009 02:57 PM In reply to rconverse Joined on 06-03-2009 Posts 13 Re: Repeating Table copy previous record Mark as Not AnswerMark as Answer... Reply Contact ^Nevermind. I just unchecked that box to update on submit or whatever. Thanks,Roger 07-10-2009 03:09 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Repeating Table copy previous record Issue.xsn Mark as Not AnswerMark as Answer... Reply Contact I am so sorry, I didn't see this post! Attached is a fixed copy, as you probably guessed it was the xpath in your count formula.... Hilary Stoupa 07-30-2009 11:07 AM In reply to rconverse Joined on 06-03-2009 Posts 13 Re: Repeating Table copy previous record Mark as Not AnswerMark as Answer... Reply Contact I don't know what my problem is, but I can never get the repeating tables to work with preceding-sibling. I have a repeateing table setup. It's called Group4. preceding-sibling::group4[1]/PROD_ID ^That's what I'm putting in the formula, but it's saying: "preceding-sibling::group4/PROD_ID" does not point to a valid location path of a field or group. What am I doing wrong? 07-30-2009 12:05 PM In reply to rconverse Joined on 06-03-2009 Posts 13 Re: Repeating Table copy previous record Mark as Not AnswerMark as Answer... Reply Contact I figured it out finally. Man, the devil really is in the details. 10-11-2009 09:25 PM In reply to kiranps Joined on 08-08-2009 Bangalore, India Posts 16 Re: Repeating Table copy previous record Mark as Not AnswerMark as Answer... Reply Contact Hi rconverse, Could you please tell me what correction you made to get this problem resolved. I am also getting the same issue. Thanks. Thanks,Kiran 10-11-2009 09:31 PM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: Repeating Table copy previous record Mark as Not AnswerMark as Answer... Reply Contact Did you attempt the solution I offered you? Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 10-11-2009 09:38 PM In reply to kiranps Joined on 08-08-2009 Bangalore, India Posts 16 Re: Repeating Table copy previous record Mark as Not AnswerMark as Answer... Reply Contact Ya Jimmy, i tried your recommendation. But i guess i am missing something. Assuming the following, would you be able to help > * There is only one primary data source. * The table is called 'Review' * The datafield is called 'Reviewer' Thanks. Thanks,Kiran 10-11-2009 09:46 PM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: Repeating Table copy previous record Mark as Not AnswerMark as Answer... Reply Contact Could you attach that screenshot of your data source that I requested? That would make it easiest to know what the exact node prefixes and relative locations are. Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 10-12-2009 09:17 AM In reply to rconverse Joined on 06-03-2009 Posts 13 Re: Repeating Table copy previous record Mark as Not AnswerMark as Answer... Reply Contact This what I enede up as a formula. preceding-sibling::group8[1]/PROD_DESC HTH, Roger Page 1 of 3 (36 items) 1 2 3 Next > Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Hello,
Is there a way to have a repeating table copy the record prior to create the "new record"? If so and anyone could post code, I'd be very appreciative.
Thank you,
Roger
Hi -- so what you want is when you insert a new row in a repeating table, the new row has the same values as the previous row? You can use preceding-sibling for this, no code required. I've attached a sample to the header of this reply. Right click the link and select save as to save locally. Then, right click the local copy and select design. Preview the form to try.
Exactly. Thanks!
Do you think you could reccomend a good overall InfoPath book?
Patrick Halstead's book is fantastic, but I'm really hot on these labs right now, because I think the hands on experience is fantastic. While these are written with IP 2003 in mind, the basics hold true through 2007, though the code object model changes....
Hilary,
I have used this techniques successfully several times... and most recently have migrated it into another form where I have a repeating section with a field that I would like to autonumber...
I cannot however seem to make this code work in this form... see attached simplified form
Any ideas
Note: I have another form where this exact same code is working just fine in a repeating section...
I was able to install that function, no problem. The problem is, I thought that if someone keyed over the copied line above it, when submitted it wouldn't revert back to copying the line above it. Is there a way to keep the functionality of copying the above row when you create a new one, but if someone keys something it "sticks"?
Thanks,Roger
^Nevermind. I just unchecked that box to update on submit or whatever.
I am so sorry, I didn't see this post! Attached is a fixed copy, as you probably guessed it was the xpath in your count formula....
I don't know what my problem is, but I can never get the repeating tables to work with preceding-sibling.
I have a repeateing table setup. It's called Group4.
preceding-sibling::group4[1]/PROD_ID
^That's what I'm putting in the formula, but it's saying: "preceding-sibling::group4/PROD_ID" does not point to a valid location path of a field or group.
What am I doing wrong?
I figured it out finally. Man, the devil really is in the details.
Hi rconverse,
Could you please tell me what correction you made to get this problem resolved. I am also getting the same issue.
Thanks.
Did you attempt the solution I offered you?
Ya Jimmy, i tried your recommendation. But i guess i am missing something.
Assuming the following, would you be able to help >
* There is only one primary data source.
* The table is called 'Review'
* The datafield is called 'Reviewer'
Could you attach that screenshot of your data source that I requested? That would make it easiest to know what the exact node prefixes and relative locations are.
This what I enede up as a formula.
preceding-sibling::group8[1]/PROD_DESC
HTH,