Forum Discussion
Don't have a lot of time either, but as everyone says - the record ID does not exist until saved. Luckily, during an add record, when using a custom button on that sheet, you can use the %%rid%% and SaveBeforeNavigating commands to capture the newly saved record ID. Basic button code below, you would just need to sub in your information. This would use a formula rich text field.
var text RID = If([Record ID#]>0, ToText([Record ID#]), "%%rid%%");
var text EditRecord = URLRoot() & "db/" & dbid() & "?act=API_EditRecord"
& "&apptoken= xxxxxx" // if you have the need for Application Tokens enabled.
& "&rid=" & ToText($RID)
& "&_fid_99=now"; // sets this field to current date time but you can set any fields you need as typical
var text DisplayRecordButMissingRID = URLRoot() & "db/" & dbid() & "?a=dr&rid=";
var text URL =
$EditRecord
& "&rdr=" & URLEncode($DisplayRecordButMissingRID) & $RID; // the %%RID%% does not like being URLEncoded.
//below makes the button. Save before navigating and data-replaceRID=true are the important bits
"<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #1ba802; border-radius: 5px; color: #ffffff; display: inline-block; padding: 2px 2px 2px 2px; width:200px; text-align: center; text-shadow: none; border: 2px solid #1ba802; font-size: 18px \"href='"
& $URL
& "'>Button Words Here</a>"
------------------------------
Mike Tamoush
------------------------------
Hi Mike,
Im getting error, The Application Token dpvtvtrbuvtrjjd5ydp38bccn9np has not been assigned to this Application. To read about assigning an Application Token to your application go to https://help.quickbase.com/user-assistance/app_tokens.html
Same Api I'm using across the application but it is working fine
Thanks
Manohar
------------------------------
manohar vankireddy
------------------------------
- MikeTamoush2 years agoQrew Commander
Application tokens are an extra level of security, so it is best practice not to post the tokens in this forum (or any place public).
Regarding the error, that must mean that either there is a typo in the application token, or you have used the token in a different application, but not this one - and the token is not assigned to this particular app. Go to your settings, manage application tokens and double check the token exists and is typed correctly (no accidental spaces or anything in your code either). If both of those things are true, then I would put in a customer support ticket.
------------------------------
Mike Tamoush
------------------------------ - MarkShnier__You2 years ago
Qrew Legend
Manohar,
I suggest that you the the Settings for the application, and Advanced settings and then disable the need for Application Tokens.
If you're asking for help with a formula from this community it's very important to copy and paste your exact formula into the discussion so we can see exactly what you have.
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------- manoharvankired2 years agoQrew Trainee
Hi Mike,
The app token is functioning correctly within the same table and another table, but I receive an error when attempting to use it with the formula belowvar text RID = If([Record ID#]>0, ToText([Record ID#]), "%%rid%%");var text EditRecord = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord"& "&apptoken= Apptoken" // if you have the need for Application Tokens enabled.& "&rid=" & ToText($RID)& "&_fid_10=" & Now(); // sets this field to current date time but you can set any fields you need as typicalvar text DisplayRecordButMissingRID = URLRoot() & "db/" & Dbid() & "?a=dr&rid=";var text URL =$EditRecord& "&rdr=" & URLEncode($DisplayRecordButMissingRID) & $RID; // the %%RID%% does not like being URLEncoded.//below makes the button. Save before navigating and data-replaceRID=true are the important bits"<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #1ba802; border-radius: 5px; color: #ffffff; display: inline-block; padding: 2px 2px 2px 2px; width:200px; text-align: center; text-shadow: none; border: 2px solid #1ba802; font-size: 18px \"href='"& $URL& "'>Button Words Here</a>"
Thanks,
Manohar
------------------------------
manohar vankireddy
------------------------------- MarkShnier__You2 years ago
Qrew Legend
Please post your actual code. Which is not working. Perhaps you have a space in front of the application token string.
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------