Forum Discussion
- katlyncowleyQrew Assistant Captain
The record ID (or rid) is not assigned until the record is saved for the first time.
------------------------------
Katlyn Allen
kallen@eatatjacks.com
------------------------------- MarkShnier__YouQrew Legend
This can be done using the SaveBeforeNavigating syntax but I would have to find time to write this up. I'm busy with taxes and other client work.
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------
- MikeTamoushQrew Commander
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 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>"
------------------------------
Mike Tamoush
------------------------------- manoharvankiredQrew Trainee
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
------------------------------- MikeTamoushQrew 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
------------------------------