Forum Discussion

ltduranltduran's avatar
ltduranltduran
Qrew Cadet
8 years ago

Can I set my form to ""Save & Keep Going"" based on a time interval of some sort?

I realize this probably can't be done natively within Quickbase, but does anyone have any ideas on how to work this functionality into a form? My particular use case calls for my users to fill out a form, and often times this form may take over an hour to fill out. Unfortunately, QuickBase's page token error only allows a form to be open for 60 minutes so I am trying to find a way around this.

I have tried running an auto-refresh script in the browser, but none of the information that has been previously entered into the form is saved when the browser refreshed. I assume the only way around this is to get the form to save automatically with some form of CRON. Thoughts?
  • This is easy to do using IOL.

    If you change the target attribute of the editform form to point to an iframe when the form submits it will submit to the iframe rather than reload the page and you can continue to edit the form from exactly where you left off (because the page never reloaded - you are still on the same form). If you additionally reload the page at some interval less than 60 minutes you can defeat the time out.

    The code would be similar to what is in this pastie:

    What is the "Play the Field" Technique?
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=413
  • AlexWilkinson's avatar
    AlexWilkinson
    Qrew Assistant Captain
    When faced with a long form, my preference is to use native Quick Base features to break it up into workable pieces. Make some copies of the form, let's say 3 copies plus the original. Keep the original as the default form for viewing a record. For editing, at section headings, reduce the 1st copy to the first third of the original, the 2nd copy to the middle portion, and the 3rd copy to the last third. Then at the end of each editing form, place a custom button called "Save & Continue" that saves the record and reopens it with the dfid for the next portion. Reply back here if you need help on the custom button.

    Other advantages of this method: The smaller forms will load faster than the full-length original. Reliance on non-native methods like IOL raises the risk of something breaking in a future release of Quick Base.
    • _anomDiebolt_'s avatar
      _anomDiebolt_
      Qrew Elite
      Reliance on native methods raises the risk of something not being achievable.
  • I have explored the option of breaking up the form into smaller parts (in fact, I still may do this); however, due to the nature of this particular use case, even by breaking it up, part of my form might take more than an hour to complete, as it is tied to a 1 hour in-person observation. This form is filled out on an iPad as the observation occurs. mo_an the ultimate would you be able to help me piece this together perhaps?

    Thank you!
  • Sure mo_an the ultimate can help. There might even be an easier solution - namely to disable the 60 minute timer if it is fully implemented client side. Can you send me the exact text that shows up when you get this message? This might allow me to find the relevant JavaScript and disable the timer.
    • _anomDiebolt_'s avatar
      _anomDiebolt_
      Qrew Elite
      I will wait. Send me the exact error message so I have text to search the source for.

      Page Tokens are a little weird. Sometimes they are on the page but never really used (they are supposed to be a security nonce - meaning used only once) by the server. The relevant question is does the server respect "expired" Page Tokens or it there just a timer in the source code nagging you after 60 minutes.
    • ltduranltduran's avatar
      ltduranltduran
      Qrew Cadet
      The exact text is as follows: 

      The time limit on the last page expired. You must submit the page within 60 minutes of when it is first displayed. Please refresh the last page and try again. Also, you may need to close and restart your browser if it has been open for a few days.