Parent form postback when using Related Items within form


Posted by Jdubs - Jun 8 ’16 at 01:24

So, I'm in a bit of a conundrum.  I don't know if I can fix it :(


In my regular form, I capture the time when the form is opened; I then capture the time when the form is closed within the on.submit function and use that to get how many seconds the form is opened total.


That's been working fine for months now.


However, I added a "Related Items" section to the form and noticed that when you save a Related Item (that's opened in a dialogue box), it resets the parent form and my code no longer works anymore.


I dunno what I'm asking ... is it possible for the Related Items section to not affect the parent form at all until the user clicks "Save" on the parent form?


It seems as if the Related Items force submits the parent form, and I'm just not clear enough on how all that functionality works to try and make my exisiting code still work as intended.


  • Dmitry Kozlov
    Dmitry Kozlov
    Member for: 8 years 2 months 10 days
    #1 by Dmitry Kozlov Jun 9 ’16 at 03:14


    SharePoint refreshes the parent form with postback after adding/editing child items, so a user will not lose populated data. You only need to check in your script whether the field containing opening time is already filled-in and do not modify it in this case.

    Another option is using grid mode:

  • Jdubs
    Member for: 6 years 11 months 11 days
    #2 by Jdubs Jun 10 ’16 at 10:20

    [#1]: Thanks Dmitry.

    I was using a local variable to capture this information (vs. storing the value in an actual SharePoint field).


    After lots of trial an error, your post helped me to get to viable solution.


    Much appreciation.

Displaying 1 to 2 of 2 messages