Forum Discussion
ChayceDuncan2
6 years agoQrew Cadet
URL Buttons can be a little tricky because Quick Base is re-directing the page and it injects its own save prompt when things have changed.
That said - you can set up a new button that 'clicks' the save button for them using a rich-text formula that will work the same way from above with a little modification.
So if your url-button does this now:
Make a new Formula Rich Text and copy this:
This will make your editRecord call then save the page. I'd recommend if you go this route that you actually have 2 buttons - one for when they are on the 'View' versus 'Editing'. The reason is that when they're viewing this record, there is no save button to click - so its better to use Mark's version for 'viewing' so that the page still reloads
Chayce Duncan | Director of Strategic Solutions
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base
That said - you can set up a new button that 'clicks' the save button for them using a rich-text formula that will work the same way from above with a little modification.
So if your url-button does this now:
var text URL = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=cpaz2k7njc4ifc24muhvc749ast&rid=" & [Record ID#]
& "&_fid_58=1";
"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);"
Make a new Formula Rich Text and copy this:
var text URL = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=cpaz2k7njc4ifc24muhvc749ast&rid=" & [Record ID#]
& "&_fid_58=1";
"<a class='Vibrant' href='#' onclick='" &
"javascript: {" &
"$.get(\"" &
$URL &
"\");" &
"$(\"#saveButton\").click();" &
"}'" & ">CLICK HERE</a>"
This will make your editRecord call then save the page. I'd recommend if you go this route that you actually have 2 buttons - one for when they are on the 'View' versus 'Editing'. The reason is that when they're viewing this record, there is no save button to click - so its better to use Mark's version for 'viewing' so that the page still reloads
Chayce Duncan | Director of Strategic Solutions
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base
SarahClark
6 years agoQrew Cadet
Thank you. I tried this and it didn't work -- it made the button, but it didn't do anything when I clicked it.
In any case, I'm looking to do things in the opposite order - save the record first, and then have the button do whatever else it does. As it stands, if you click the button before you've saved, it gives them error messages they don't know what to do with. I've got a text on the form that says "Save any changes before clicking submit," and that may be the best I can do, but in my perfect world I'd have a button for them to "save and submit.
In any case, I'm looking to do things in the opposite order - save the record first, and then have the button do whatever else it does. As it stands, if you click the button before you've saved, it gives them error messages they don't know what to do with. I've got a text on the form that says "Save any changes before clicking submit," and that may be the best I can do, but in my perfect world I'd have a button for them to "save and submit.