locked
Dynamically Populating Rows in a Repeating Table? RRS feed

  • Question

  • Hello folks,

    I have a question regarding dynamically populating an InfoPath repeating table and if it is possible with InfoPath built-in features. I currently have several fields on an InfoPath form that data can be entered into and an update button that will save the changes to the form library. I also have a History section that contains a repeating table containing all the fields on the form prefaced by the word "History". The purpose of this repeating table is to track historical data on the form. Therefore, for instance, any time the customer enters a new activity or modifies an existing activity on the form, once the update button is clicked, an entry is added to the repeating table to track all the changes. I know how populate other fields with data by "moving" data from one field to another but I don't know how to dynamically add an additional row to a Repeating Table/section with built-in InfoPath features. I have tried to display an example below. Any help would be greatly appreciated.

    ACTIVITY FIELDS ON FORM:

    Activity ID

    Activity Name

    Activity Description

    <UPDATE BUTTON HERE>

    HISTORY SECTION ON THE FORM (repeating table/section):

    History ID

    History Name

    History Description

    ---------------------------------------------------

    Based on the example above, if an Activity ID, Name, and Description is entered at the top of the form and the Update button is pressed, I wish to add a new entry to the repeating table with those fields to essentially "track changes" of all historical data. Ofcourse, there will be more fields that those listed above but this is just an example. There may be a need to modify someone's existing form and I have a need to track the fields that existed on the form prior to any changes. I have seen numerous examples using C# code but I wish to know if there is a way to perform this with the built-in features for InfoPath. Again, any help would be greatly appreciated.

    Monday, March 21, 2011 6:51 PM

Answers

All replies

  • Hi Dan, to my knowledge there is no way to accomplish this with built-in features.  Check out this link to see if you could utilize any of these methods:

    http://www.bizsupportonline.net/infopath2007/4-way-programmatically-add-row-repeating-table.htm

     

    • Marked as answer by Dan Hudnall Tuesday, March 22, 2011 8:06 PM
    Monday, March 21, 2011 7:05 PM
  • Melli111

    Thank you very much for the reply to my question. I did not think there were any built-in features that would allow me to perform this operation but I figured I would ask. As far as programming methods, are there any limitations or constraints to keep in mind when going that route? For example, I was once told by another SharePoint administrator that the form would have limitations when published to SharePoint if coding was behind the form. Do you have any knowledge of these kind of constraints or points to take into account when using this approach? Thanks again for your help.

    Tuesday, March 22, 2011 12:37 PM
  • Hi Dan,

    Yes, there are some things to consider.  One things is - are you using your form as a browser-form, or are your users opening it in the InfoPath client?  The browser-enabled InfoPath form doesn't like all code, but will accept code.  The code must be written in the InfoPath 2007 object model... which means don't make your form 2003-compatible if you're planning to browser-enable this form.

    Another thing is that adding code to the form requires raising the forms Trust level (Tools > Form Options > Security & Trust).  By default the form decides the security level on its' own.  Typically I set my forms with code to full trust.  Now, setting the form to full trust requires that the form designer sign the form with a security certificate.  Ask your IT dept if they already have a certificate store, or if they have Microsoft Certificate Services installed on any of your servers.  Also with this level of trust the form usually needs to be deployed as an "Administrator Approved" form.  This can be tricky to someone who's never done it, but it's really not too bad - InfoPath just didn't really make it clear how and Administrator approves the form. 

    For an administrator approved form, you go through the publishing wizard in your form (it will tell you if it has to be an admin approved form).  Go through all of the steps and it will ask you to save it somewhere that the administrator can access (such as a network drive).  Complete the publishing wizard.  Have your SharePoint admin (or yourself, if that's you as well) go to Central Administration for the SP site and upload the form from the location you specified in the publishing wizard to the Manage InfoPath form templates section.  Then activate the form to your site.  It is then available as a content type in your libraries.

    So, now that it's a content type, go to the library you want it on.  Go to Settings > Form Library Settings > Advanced Settings.  Select to "Allow management of content types".  Click Ok.  Now you'll see in the form library settings a section for content types.  You want to add an existing content type.  Select the name of your form and click ok.  Then you can manage the "new button" and default content type to only allow that form. 

    Once you have done all that if you need to make changes to the form and re-publish you don't need to perform all of those steps again.  You should be able to just go through the form's publishing wizard and be done. 

    Tuesday, March 22, 2011 12:56 PM
  • Melli111,

    Once again you have been extremely helpful and I will definitely take all of that information into account. We are currently only using the InfoPath client as the form is not browser-enabled. In regards to using the InfoPath client, will I still be able to write code and make it 2003 compatible? Also, we are currently using numerous versions of software and I am not sure if this will complicate matters or not. I have listed the software I am currently using below. Some users are still using Windows XP and Office 2003.

    Windows 7 with Office 2010

    SharePoint MOSS 2007 

    Tuesday, March 22, 2011 4:33 PM
  • Yes, you can write code and make it 2003 compatible if it's not browser-enabled, so you're good there.

    Those systems should be fine as well.  However I have not been in an environment with Office 2010 yet to know if there is anything we should be aware of - which version of InfoPath are you designing the form in? 

    MOSS 2007 works wonderfully with InfoPath of all versions, so you're good there as well.

    One thing I should mention since you're going to do programming on a form that will be opened in the client application (aka Filler Form):  is that you may need to update the user's installation.  (go through the Add or Remove programs on their machine, find microsoft office, click change, then choose add or remove features, expand InfoPath and make sure the .net programmability support is not greyed out - greyed out means the feature is not installed).  They must have that feature installed for it to run.  IF you cannot add that feature, they need to update their asp.net..... I think they have to have 1.0 or greater.

    Tuesday, March 22, 2011 6:02 PM
  • Melli111,

    That is exactly what I needed to hear and thanks again. I was always told that adding code to the form required taking numerous things into account that you wouldn't normally have to do when publishing a form using standard functionality. I will make sure I run all of this by my other SharePoint admin before we proceed with development. Thanks again for all your help.

    Tuesday, March 22, 2011 8:05 PM