Creating duplicate forms when filename changes - InfoPath Dev
in

InfoPath Dev

Creating duplicate forms when filename changes

Last post 08-06-2014 04:21 PM by JenniferLindsay. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 07-24-2014 10:51 AM

    Creating duplicate forms when filename changes

    I followed this blog on how to create a unique filename each time a form is submitted (http://www.codeproject.com/Articles/37093/Submitting-an-InfoPath-Form-to-SharePoint-with-a-U).  It has been working fine, with one exception.  Anytime someone edits the field that I use in the concat filename, and resubmits, it creates a duplicate.  The duplicate has the original filename, and the form they edited has the new name.  Is there a way to make it so that the field can be edited, but it does not create a duplicate?

    Thanks!

    Filed under: ,
  • 08-03-2014 11:24 PM In reply to

    Re: Creating duplicate forms when filename changes

     How about creating a form field called FormName and then in your submit data connection make sure the form name is set to this field (no concat formula, just the plain old field). Then add a new rule on your submit button (make sure this new rule executes BEFORE the rule that actually does the submitting) that sets the FormName field value to be your concat formula. Make sure this rule only executes for the condition FormName is blank.  After the form is submitted for the first time, FormName will no longer be blank, so the next time someone clicks the submit button this rule will NOT execute, the FormName field will not change and the form will be overwritten.

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

  • 08-04-2014 08:09 AM In reply to

    Re: Creating duplicate forms when filename changes

    Hi Jennifer,

    Thanks for your response!  What you suggested is actually what I do already.  The FileName (as I call it), is a concat of an asset name, and now().  If someone goes into the form and edits the asset name, it then creates a duplicate.  I can't figure out why it is doing this.  Someone else suggested that I change the now() to the ID (max (ID) +1).  But it still has something to do with the other field that is edited on the form.

  • 08-04-2014 11:00 AM In reply to

    Re: Creating duplicate forms when filename changes

     Have you double checked that you don't also have that same formula set as the FileName default value? Also, have you double checked that the rule that sets the FileName to your formula has the condition "FileName is not blank"?

     

    It sounds to me like you either have a default value formula or another rule somewhere that is updating the FileName each time the asset name changes. I would right click on the FileName field and check the Rule Inspector, which will show you every rule that affects the FileName field.

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

  • 08-04-2014 11:04 AM In reply to

    Re: Creating duplicate forms when filename changes

    See attached form.  I think this may be what you are looking for.

  • 08-04-2014 03:27 PM In reply to

    Re: Creating duplicate forms when filename changes

    I've realized that the problem actually occurs when you edit the properties, and change the name there.  It doesn't create a duplicate when you edit the name, but when someone goes to open edit the actual form again, it creates a duplicate.  Sorry for the misinformation.  Does anyone know why it does this?

  • 08-05-2014 08:25 AM In reply to

    Re: Creating duplicate forms when filename changes

    When you change the filename outside of the form, it doesn't change the internal field that controls the filename.

    If you change the filename in Sharepoint, and then open and resave the form, it uses its internal field as filename and creates a duplicate of the original filename.

    Is this what is happening?

  • 08-05-2014 08:35 AM In reply to

    Re: Creating duplicate forms when filename changes

    Yes, that's exactly what is happening.  I knew that by changing the filename outside of the form, that it wouldn't change the field on the form.  What I was doing was changing the field on the form, and of course that wouldn't change the filename.  So I would edit the properties and change it there.  Is there a way to make it so that it does not create duplicates?

    Thanks for the explanation.  It clears up a lot!

  • 08-05-2014 08:47 AM In reply to

    Re: Creating duplicate forms when filename changes

    Here is how to do it.
    Be careful using this way since any rules that the field may use will not run.

    http://www.infopathdev.com/forums/p/21550/74489.aspx#74489

  • 08-06-2014 11:34 AM In reply to

    Re: Creating duplicate forms when filename changes

    This doesn't seem to help anything unfortunately.  I clicked the "Allow users to edit data in this field by using a datasheet or properties page."  But if I change the filename outside of the form, on the edit properties page, it still creates a duplicate if I open and resave the form.  Am I missing something?

  • 08-06-2014 01:44 PM In reply to

    Re: Creating duplicate forms when filename changes

    After you published, did you update(open and click "Save and Update") the form before changing the filename?

    I got it to work by opening a previous form, updating it, and then resaving it as is.

    This will unfortunately only work on forms that are new(after you published the updated template) or on forms that you open and resave using the updated template.

    I have not gotten it to work any other way.

  • 08-06-2014 03:07 PM In reply to

    Re: Creating duplicate forms when filename changes

    May I ask why you are editing the form name outside of the form?

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

  • 08-06-2014 03:22 PM In reply to

    Re: Creating duplicate forms when filename changes

    If someone goes into the form and changes the asset name, it would be nice to have the form name (filename) match that.  But as you know, the filename won't change when you change the asset name on the form.  If someone is searching for the form, and they know the asset is called XYZ, but the name you see on SharePoint is ABC, it won't come up in the search. I would prefer for them to match, which is why I started editing outside the form.

  • 08-06-2014 04:21 PM In reply to

    Re: Creating duplicate forms when filename changes

     Well I think the easiest solution would be to remove the asset name from the form name.  In general, it is best to choose values for the form name that will not change.

     Instead, I would make the Asset Name a promoted property, which will give it its own column in the SharePoint library. Then if the asset name in the form is ABC but the name someone is searching for is XYZ, then you can just open the form, change the asset name, resubmit, and then the Asset Name column will change from ABC to XYZ...and all along, the form name will not change and so the form will overwrite on submit.

     Does that make sense?

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

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