Form Load rules unexpectedly running multiple times - InfoPath Dev
in

InfoPath Dev

Form Load rules unexpectedly running multiple times

Last post 04-06-2017 03:56 PM by dlafbsci. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-05-2017 09:23 AM

    Form Load rules unexpectedly running multiple times

     Right away, I'd like to lay out my theory regarding my problem: Submitting and closing and reopening a form seems to be a different "thing" than simply submitting.

     I have a form that during Form Load sets a filename via the classic userName+now concat. It also grabs and displays a SharePoint ID number on the form via a double submit (Submit, Query, Set ID Field, Submit). Both of these rules run on the condition "is blank", so opening already submitted forms does not change these values. I do this during Form Load rather than the final Submit because this form in addition to being electronically submitted must also be physically printed out; I can't expect users to close-reopen-print-close rather than just print-close.

     Now to the issue: Particular users (not everyone) seem to have an odd issue where several submissions are happening in rapid succession. In the attached screenshot we see that we have a 2nd doc created 10 seconds later, a 3rd 7 seconds after that, and a 4th 1(!) second later.

     I'm partially able to recreate this problem myself, by starting a new form and then refreshing my browser. Each time I click refresh instead of returning to the same filename and ID it creates a new document again! This seems odd to me because the form has already been submitted to the SharePoint - neither of the rules that create a new filename or fetch an ID number should run, because those values are not blank. And yet, it acts as though nothing is filled in, so it creates a new document.

     Curiously, if I add a new document, then close the form and reopen it, I can refresh the browser as many times as I want and it acts as expected - retaining the same filename and ID. 

     So what's happening here? Why does a document I just created, and has been submitted twice via rules, behave differently than a form I actually close and reopen? My guess is that whatever causes this behavior is what's causing the screenshot issue for my users. Maybe a weak Wi-Fi signal or some browser configuration is causing their browser to "refresh" a few times before settling? Google has finally failed me ;)


  • 04-05-2017 02:07 PM In reply to

    Re: Form Load rules unexpectedly running multiple times

    Take a look at the difference in the URLs between a new doc & when you open an existing doc. I'm pretty sure that would explain the behavior you see when you are refreshing. However - I don't know what is causing the issue you are seeing for some users.
    Hilary Stoupa

  • 04-05-2017 02:30 PM In reply to

    Re: Form Load rules unexpectedly running multiple times

     Thanks for the reply! I think I've read hundreds of your posts :) 

     So keep in mind I have literally no background in any web development at all... I figured nearly everything out via this site. I might not have the right vocabulary for some of this!

     It looks like an existing doc URL is pointing to the actual saved XML file and location, whereas a new doc URL is pointing to the XSN template. I guess that makes sense then that a refresh of that URL would simply start the process over.

     Is there a way after I've established my filename to... actually "send" the user to the appropriate URL that was created via my submit rules? So that they're working off the new XML file rather than the template (as if they had closed and reopened)? Does that makes sense? Haha :)

  • 04-05-2017 02:39 PM In reply to

    Re: Form Load rules unexpectedly running multiple times

    It makes complete sense, actually - but I can't think of any way to do that via built in InfoPath stuff.... Even if you tricked them into clicking a URL on the form or something that would then actually open the saved form - it would open in a new tab & leave the old form sitting in the old tab.
    Hilary Stoupa

  • 04-06-2017 03:56 PM In reply to

    Re: Form Load rules unexpectedly running multiple times

     Thanks again. I talked to a user today that I saw had one of these multi-submits and asked if his browser refreshed or anything while he was filling out the form... the answer was no. The form that ended up getting properly completed ended up being the first file; the extra copies were created after. So it seems like somehow these Form Load rules are running and executing additional times in the background WHILE the original is still being filled out. Strange.

     

    Again with the caveat that I have no idea what I'm talking about...

     

    Could "Postback" settings for any of these fields that I'm manipulating during Form Load potentially cause any strange behavior? They are all on the recommended 'only when necessary' settings - could changing them to 'Never' or 'Always' have any kind of effect on how these forms are getting submitted?? I'm just grasping at straws here.

     

    EDIT:

     I found out the root cause! I have a people picker field that adds those selected into the CC field of an email that goes out upon form completion. When users manually type into the people picker rather than use the actual buttons, when the picker 'fails' (types the name incorrectly) it posts back to the server and creates a new document in the background. Now I just need to figure out how to stop that! :)

     

     

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