Forum Discussion
AJCampani
5 years agoQrew Cadet
Yes please I would appreciate help with it.
------------------------------
Albert Campani
------------------------------
------------------------------
Albert Campani
------------------------------
MarkShnier__You
Qrew Legend
5 years agoOK here goes,
We need to make a URL formula field to edit the record and land the user in edit mode on the record.
When using API's which update records, we either need to have what is called an application token.
You may or may not want to keep the need for those enabled those enabled. many of my clients choose to disable the need for them. That is a setting on Application Properties for the App settings.
Here is the code for a button. Post back with your code and any error messages as I'm free form typing this without the benefit of he formula syntax editor!
You can get the field ID# by right clicking a field name on the form or looking at the field properties under Usage or in the URL.
// this is a comment
//this is a formula variable below
var text ClearFields = URLRoot() & "db/" & dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=cxcxcxcxcxcxccxcxcxxcxc" // insert your app token here is you have them enabled
& "&_fid_90=" // clear field ID 90 change the 90 to the field ID# of your own fields.
& "&_fid_91=" // clear field ID 91
& "&_fid_92=" // clear field ID 92
& "&_fid_93="; // clear field ID 93 and end the formula variable with a semi colon
// new formula variable to display the record in edit mode.
var text DisplayInEditMode = URLRoot() & "db/" & dbid() & "?a=er&rid=" & [Record ID#];
$ClearFields
& "&rdr=" & URLEncode($DisplayInEditMode)
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
We need to make a URL formula field to edit the record and land the user in edit mode on the record.
When using API's which update records, we either need to have what is called an application token.
You may or may not want to keep the need for those enabled those enabled. many of my clients choose to disable the need for them. That is a setting on Application Properties for the App settings.
Here is the code for a button. Post back with your code and any error messages as I'm free form typing this without the benefit of he formula syntax editor!
You can get the field ID# by right clicking a field name on the form or looking at the field properties under Usage or in the URL.
// this is a comment
//this is a formula variable below
var text ClearFields = URLRoot() & "db/" & dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=cxcxcxcxcxcxccxcxcxxcxc" // insert your app token here is you have them enabled
& "&_fid_90=" // clear field ID 90 change the 90 to the field ID# of your own fields.
& "&_fid_91=" // clear field ID 91
& "&_fid_92=" // clear field ID 92
& "&_fid_93="; // clear field ID 93 and end the formula variable with a semi colon
// new formula variable to display the record in edit mode.
var text DisplayInEditMode = URLRoot() & "db/" & dbid() & "?a=er&rid=" & [Record ID#];
$ClearFields
& "&rdr=" & URLEncode($DisplayInEditMode)
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
- AJCampani5 years agoQrew CadetThanks for the formula Mark! I just tried it but I'm getting an error regarding the app token. I have them enabled and I tried using a new one I created as well as one already in use (for syncing an outlook account to the same app).
Here's my modified formula:
var text ClearFields = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=xxxxxxxxxxxxxxxxxxxxxxxxx"
& "&_fid_297=" // related tenant
& "&_fid_304="; // assign lease
var text DisplayInEditMode = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & [Record ID#]; // new formula variable to display the record in edit mode.
$ClearFields
& "&rdr=" & URLEncode($DisplayInEditMode)
and this is the error code I get:
This XML file does not appear to have any style information associated with it. The document tree is shown below.<qdbapi><action>API_EditRecord</action><errcode>24</errcode><errtext>Invalid Application Token</errtext><errdetail>The Application Token xxxxxxxxxxxxxxxxxxxxxx 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</errdetail></qdbapi>
The older token was last used this morning so I think its working properly. Any ideas?
------------------------------
Albert Campani
------------------------------- MarkShnier__You5 years ago
Qrew Legend
Ok, we will sort this out here or if necessary I can jump on a quick zoom call..
Is the app then correct? Is there a leading space perhaps in front of the app token.
Is it definitely an apptoken and not confused with a usertoken?
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------- AJCampani5 years agoQrew CadetYou called it - I was plugging in a user token rather than an app token. Just fixed it and it works perfectly. Many thanks, I appreciate your time and your expertise.
Have a great weekend!
AJ
------------------------------
Albert Campani
------------------------------