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
- SarahClark6 years agoQrew CadetThank 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. - ChayceDuncan26 years agoQrew CadetI guess reading this through again I have a different question. Is there a way you can eliminate the button altogether - and instead use an automation? With the above button I copied you should be able to just put the snippet $(\"#saveButton\").click(); as the first part of your javascript so the save occurs first.
Is there something specific about this button that can be accommodated by having them just save the record like they normally would - and then use an automation to make whatever final changes you need?
Chayce Duncan | Director of Strategic Solutions
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base - SarahClark6 years agoQrew CadetThe user would still need to do something proactive to indicate "I'm done" - whether it's checking a box manually or clicking a button.
The simplest solution would be to have them check the box manually when they are done and then Save and Close one last time. But for various reasons, a button is better for my users.