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
ChayceDuncan2
6 years agoQrew Cadet
I 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
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