Forum Discussion
You can do this with a Formula URL and if I read your question right, if you want the page to be saved before doing the API_EditRecord, you could do it with javascript but let's try it with a Formula URL that doesn't require javascript.
You will want to turn on: Learn more located under App Properties. Also, only a Formula URL field will save the parent record whilst you navigate away from a changed record. It won't save the record if you use a formula rich text field. Also, even if you use a formula url field, and you are on a parent record and nothing has changed on that record, you will be redirected to your rdr= url but the form doesn't see any changes so it will redirect without saving. (just a few learned lessons).
You will want to create a formula url field and use the following:
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=cpaz2k7njc4ifc24muhvc749ast&rid="&[Record ID#]
& "&_fid_102=" & URLEncode("Approved")
& "&_fid_103=" & Now()
& "&_fid_105=" & URLEncode(User())&
"&rdr="&URLEncode(URLRoot()&"db/"&Dbid() & "?a=dbpage&pageID=33")
See video:
https://drive.google.com/file/d/18luV8HqzNDoWwI2Qh7JcP-h32OC6uy-1/view?usp=drivesdk
There is another way of doing this by invoking an onload to override the QuickBase redirect url but you already can use rdr= like the formula above. Also QuickBase is migrating away the use of javascript in the buttons so I'm trying to honor that with a non-javascript option whenever possible. You are welcome to comment and let your feeling be known at http://quickbase.uservoice.com.
We talk about things like this during our daily M-F webinars "Office Hours" held at 1pm Eastern time.
Hope that helps.
Kirk
------------------------------
Kirk Trachy , Senior Solutions Consultant
QuickBase | 603-674-5454 M | ktrachy@quickbase.com
------------------------------
The issue is I need the button to work on mobile reports. Formula URL Buttons do not show on mobile reports.​
------------------------------
C G
------------------------------
- KirkTrachy14 years agoQrew Assistant Captain
Christopher:
This is a formula rich text field option. It will invoke the API_EditRecord, update the fields you want to update and then redirect to another page."<a style=\"text-decoration:none; background: #f90; border-radius: 5px; color: #fff; display: inline-block; padding: 8px 8px; width:80px; text-align: center; text-shadow: none; \"href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=cpaz2k7njc4ifc24muhvc749ast&_fid_102=Approved&_fid_103="&Now()&"&_fid_105="&URLEncode(User())&"&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dbpage&pageID=33") & "' target=\"_blank\" >Approve</a>"
NOTE: This does work on Mobile reports but will not save the record first. The ability to save automatically works only with a formula url field and as you have written, the formula url type of field doesn't show up on reports. Please log a request for this functionality with our Uservoice. Also, should you come up with a solution or work around, please update the post.
------------------------------
Kirk Trachy , Senior Solutions Consultant
QuickBase | 603-674-5454 M | ktrachy@quickbase.com
------------------------------