I have a Schedule table and buttons for start and complete to change the status of the items. The buttons are used in different contexts and so having it go to a specific report is not friendly for work flow. Is there a way to have it just edit the record and stay put without going to record or to a certain report?
-
308 Points
Posted 10 months ago
QuickBaseCoach App Dev./Training, Champion
-
60,178 Points
-
308 Points
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&_fid_11=Complete" &
"&rdr=" &
URLEncode(URLRoot() & "db/" & [_DBID_SCHEDULE] & "?a=q&qid=15")
"&rid=" & [Record ID#] &
"&_fid_11=Complete" &
"&rdr=" &
URLEncode(URLRoot() & "db/" & [_DBID_SCHEDULE] & "?a=q&qid=15")
QuickBaseCoach App Dev./Training, Champion
-
60,178 Points
no problem. make a formula variable called, (I suggest), URL and then continue the formula box with the javascript refresh syntax.
var text URL =
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&_fid_11=Complete";
"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);"
Don't worry that you don't understand that javascript stuff. It just executes the formula variable called URL and refreshes whatever page you were on. It's magic.
var text URL =
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&_fid_11=Complete";
"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);"
Don't worry that you don't understand that javascript stuff. It just executes the formula variable called URL and refreshes whatever page you were on. It's magic.
-
152 Points
And if you don't need to see the change on that page immediately, you can swap out
"location.reload(true);" with the line below to remain on the same page but display a small disappearing popup. It makes it even quicker when trying to update numerous records in a report.
Just replace the bold part with whatever text you need to see in the popup.
"$.jGrowl('Record #" & [Record ID#] & " has been marked Completed', {life: 5000, theme: \n'jGrowl-green'});"
"location.reload(true);" with the line below to remain on the same page but display a small disappearing popup. It makes it even quicker when trying to update numerous records in a report.
Just replace the bold part with whatever text you need to see in the popup.
"$.jGrowl('Record #" & [Record ID#] & " has been marked Completed', {life: 5000, theme: \n'jGrowl-green'});"
-
308 Points
Works Great! Does this take you to same place on the page or just same page?
Thank You!
Thank You!
QuickBaseCoach App Dev./Training, Champion
-
60,178 Points
It refreshes the page so the user knows something happened and can see the effect of pushing the button. It probably does not go back to the same spot.
Related Categories
-
App builders
- 851 Conversations
- 42 Followers
-
APIs & custom code
- 1420 Conversations
- 51 Followers
-
App home pages
- 276 Conversations
- 6 Followers
-
Reports & charts
- 3026 Conversations
- 87 Followers
-
Tips & tricks
- 336 Conversations
- 27 Followers
-
Ask about Quick Base functionality
- 918 Conversations
- 64 Followers