Forum Discussion

QuickBaseCoachD's avatar
QuickBaseCoachD
Qrew Captain
5 years ago

Slow Down the Refresh

Many of us make URL formula buttons to do an update and then refresh the screen we are on.  

var text URL = ........;

"javascript:" &
"$.get('" & 
$URL & 
"',function(){" &
"location.reload(true);" &
"});" 
& "void(0);"

I have a use case where I need time for an Automation to run before the screen is refreshed and a child table on the form is displayed.

I know I can put my child table on a tab and cheat in a delay that way, but that would not be a good user experience.

I suppose I can cheat and redirect the user to an alternate full page view of the form that says "your update has been entered, click here to continue", but that is not so nice either.

What I would really like to know is if there is an alternate version of this Javascript above which would introduce a delay on the refresh of a second or if that is not possible, put up a small pop up where the user would click OK and that would refresh the record.  I just need a second or two delay on the refresh somehow to give the Automation time to run.

13 Replies

  • After you make your $.get you can do a setTimeout function to hold out before your reload occurs.

    So $.get(....,function(success){
    setTimeout(location.reload(),2000)
    }
    Which will wait 2 seconds and then refresh your page.
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      So not to be greedy, but to us non javascript people we don't really understand the syntax we are using.

      So what do you think this would be changed to

      "javascript:" &
      "$.get('" & 
      $URL & 
      "',function(){" &
      "location.reload(true);" &
      "});" 
      & "void(0);"
    • ChayceDuncan2's avatar
      ChayceDuncan2
      Qrew Cadet
      Trying to get the syntax right from my phone - but try this.

      "javascript:" &
      "$.get('" &
      $URL &
      "',function(){" &
      �setTimout(function(){� &
      "location.reload(true);" &
      �,2000});� &
      "});"
      & "void(0);
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      Chance,
      I tried that after fixing the curly Quotes, but nothing happened when I click. Hoping you can give it a test when your back on a real computer.