Forum Discussion
// first, either use the existing Record ID# if the record has one yet, else use the "future" Record ID# after the initial save.
var text RID = IF([Record ID#] > 0, [Record ID#], %%RID%%)
var text URL = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & $RID;
"<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #4b7097; border-radius: 5px; color: #ffffff; display: inline-block; padding: 0px 0px 0px 0px; width:100px; text-align: center; text-shadow: none; border: 2px solid #030404; font-size: 12px \"href='"
& $URL
& "'>Save and Continue in Edit Mode</a>"
// you can mess around with the button appearance by carefully adjusting the parameters above.
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------
- ProcessQ3 years agoQrew MemberHi Mark, thanks so much for this but the formula throws out an error because in the first sentence of the formula the first % symbol in "%%RID%%" is highlighted yellow
Any ideas what this could be?
------------------------------
Process Q
------------------------------- MarkShnier__You3 years agoQrew LegendSorry, I forgot the quotes.
"%%RID%%"
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------- ProcessQ3 years agoQrew MemberHi Mark, now it highlights the "%%RID%%" and says "expecting number but found text" . any ideas?
------------------------------
Process Q
------------------------------
- NolanPilozo2 years agoQrew Member
Is there a way to repurpose this to instead of opening in edit mode, it will edit a field, save, then go to a dashboard or report? Goal is to have a button to accept in a form, and when clicked it changes another fields value, saves the changes, returns to a dashboard page. I have been using the following:
var text URL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] &"_fid__20=" & URLEncode("success") &"&ticket=auth_ticket&apptoken=app_token";
"<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #4b7097; border-radius: 5px; color: #ffffff; display: inline-block; padding: 0px 0px 0px 0px; width:100px; text-align: center; text-shadow: none; border: 2px solid #030404; font-size: 12px \"href='"
& $URL
& "'>Accept</a>"Some variation of this was able to edit the field fine, but would then open some page saying it's missing xml data and force a close or back button, which is not ideal.
------------------------------
Nolan Pilozo
------------------------------- MarkShnier__You2 years agoQrew Legend
Try this as a formula URL field.
var text URL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] &"_fid__20=" & URLEncode("success") &"&ticket=auth_ticket&apptoken
=app_token"; var text Dashboard = URLRoot() & "db/" & AppID();
$URL
& "&rdr=" & URLEncode($Dashboard)
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------ - MikeTamoush2 years agoQrew Commander
You just need to add a redirect on the end of your URL. My cheat sheet below:
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" & "&rid=" & [Record ID#] &
"&apptoken=xxxxxxxxx" &
"&_fid_59=0" & //this is setting a checkbox field, replace or add fields
"&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])) //Redirect anywhere, this is to the record that was edited, but you could use a dashboardRemember, this will change slightly if you are trying to use the %%rid%% from earlier on this thread (ie, push this button while in add mode, before the RID has been established)
------------------------------
Mike Tamoush
------------------------------- NolanPilozo2 years agoQrew Member
Thanks Mike, I decided to just disable the apptoken which was the factor stopping me before, but using this I'm now having an issue where the rid is apparently missing even though I'm doing this in an edit form. Any thoughts?
------------------------------
Nolan Pilozo
------------------------------