Is there a way to avoid data loss when re-publishing forms? - InfoPath Dev
in

InfoPath Dev

Is there a way to avoid data loss when re-publishing forms?

Last post 02-01-2010 02:40 PM by Jenlianne. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 01-27-2010 04:24 PM

    • Jenlianne
    • Not Ranked
      Female
    • Joined on 01-27-2010
    • San Diego, CA
    • Posts 4

    Is there a way to avoid data loss when re-publishing forms?

    I have built multiple InfoPath forms that submit to a form library, auto-number, and populate that auto-number within the form as well.

    My problem is that when these forms need to be updated, it is always a tricky situation to avoid data loss. Is there any "good" way to publish an updated version of a form without creating an entirely new form library? I want all the forms to be located in one place, and the old forms to retain all the data that was originally captured at the time of submission, regardless of form changes made since then. Am I dreaming here? Is this possible? Please help!

     Thanks : )

  • 01-28-2010 04:53 PM In reply to

    Re: Is there a way to avoid data loss when re-publishing forms?

    Hi Jenlianne, welcome to the InfoPath Dev forums.

    Can you explain a little bit more about the data loss you are experiencing?  What exactly is happening here?  You do need to be careful when making changes to a form template so that you don't break existing forms, perhaps that is what is happening to you?

    For example here is a post Patrick made in this thread that talks about some best practices to make sure you don't change the schema in a template that willb break old forms: http://www.infopathdev.com/forums/p/5945/22530.aspx#22530

    Feel free to post back with more details so I can help more

    Ted

     

  • 01-29-2010 09:10 AM In reply to

    • Jenlianne
    • Not Ranked
      Female
    • Joined on 01-27-2010
    • San Diego, CA
    • Posts 4

    Re: Is there a way to avoid data loss when re-publishing forms?

    Hi Ted,

    I have had data loss before when renaming or deleting controls from a form, where a fields that was filled with data was cleared out. Luckily this was still while we were testing the form so it wasn't a big deal. But now I have a form that has been in use for a few months and there are a lot of submitted forms in the form library. I need to make some changes to the form template, and this includes removing some fields. So my question is, is there any way to do this without affecting the forms already submitted and living in that form library? I would rather not have to publish it to a new library because then the forms are "living" in two different areas, and this could be confusing to the user.

     I really appreciate your help on this - thanks!

     Jen

  • 01-29-2010 09:32 AM In reply to

    Re: Is there a way to avoid data loss when re-publishing forms?

    Hi Jen,

    In your situation the thing I think you need to do is NOT delete the actual node in the form schema.  If you remove a node or field in the form it will break old forms as you are changing the schema.

    Removing the field from the UI of the form is not the same as deleting the node in the data source in InfoPath.

    So for example in the attached screenshot I have a field called "CustomerChild" that I have been collecting data with and have 100 forms that have that data.  I no longer want to collect that data. What I can do is simply remove the field from the UI but not the Schema.  Old forms won't be broken.  The data will still be in the XML of the form for old forms.

    If you want to get really fancy you can do custom code for upgrading the form.  InfoPath has some built in functionality to support upgrades but sometimes you do need to write custom code to upgrade forms correctly.  If you search a bit in the forums I am sure there are some posts or blogs on doing custom upgrades in InfoPath if you really need that.

    Ted


  • 01-29-2010 09:51 AM In reply to

    • Jenlianne
    • Not Ranked
      Female
    • Joined on 01-27-2010
    • San Diego, CA
    • Posts 4

    Re: Is there a way to avoid data loss when re-publishing forms?

    Hi Ted,

    So that field you remove from the UI should still be visible in the already submitted forms? I have tried this and it seems to also remove the field from the forms that have already been submitted....not sure what I am doing wrong!

  • 02-01-2010 02:32 PM In reply to

    Re: Is there a way to avoid data loss when re-publishing forms?

    Jen,

    If you remove the field from the UI (but not the schmea) the field won't show in the form.  If you need to show the field for old forms that have the data then you should create a seperate view for old forms and make an On Load rule so that if any of the "old" fields contain data the form should switch to the view that shows the field.  You would probably want to make those fields read only in that view so users don't continue to use it.

    Does that help?

    Ted

  • 02-01-2010 02:40 PM In reply to

    • Jenlianne
    • Not Ranked
      Female
    • Joined on 01-27-2010
    • San Diego, CA
    • Posts 4

    Re: Is there a way to avoid data loss when re-publishing forms?

    Ted,

     You are a genius - that makes perfect sense. I can't believe I didn't think about doing different views!!!

     Thanks for your help,

     Jen

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