Skip to main content
Question

Button to Check, Pause, Uncheck, Refresh

  • August 30, 2021
  • 0 replies
  • 100 views

Hi,

I am trying to create a formula URl button that will check [Check Box A], pause by calling a Code Page, uncheck [Check Box A] then refresh to call a Pipeline, the pause being to give the Pipeline time to trigger.

I was using one of Kirk Trachy's Magic Buttons but I need to change it at some stage because it contains java code.

So far I've got this but not sure what the Code Page "URl is to execute" is.

----------------------------------------------------------------------------------------------------------------------------------

//Check FID 367 then Uncheck FID 367
var text url =

URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=c7y3n83dz8fuc2n8jum5dzq4iky&rid=" & [Record ID#] & "&_fid_367=1&rdr=" &
URLEncode(URLEncode(URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=c7y3n83dz8fuc2n8jum5dzq4iky&rid=" & [Record ID#] & "&_fid_367=0"));

//Call Code Page
var text callCodePage =
URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=10" // Open CodePage 9
& "&url=" & URLEncode($urlToExecute) // Pass in the URL to execute

// Add some button styling
var text style = "style='background-image: linear-gradient(to bottom, #00b300 0%, #00b300 100%); background-color:#00b300;color: white;' ";

Any assistance would be appreciated.

------------------------------
Tim Egerton
------------------------------
This topic has been closed for replies.

Hi Tim,
I am no Quick Base expert but I have been dealing with Kirk's magic button app and videos lately. I think what the highlighted portion is looking for is a url reference to a code page in the app home. In the app home you can make code pages which can have higher functions. I would check Kirks magic button's pages to see if he has a code page with the code for this button. From there mimic his code page and  copy the URL into the button code. I hope this helps a little bit.
-Hank

------------------------------
Hank Halverson
------------------------------

  • Registered
  • August 30, 2021
https://community.quickbase.com/blogs/ryan-pflederer1/2021/03/01/using-code-pages-to-refresh-with-a-delay?CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804

It looks like you are using this or something similar to it and this page explains what the urlToExecute is. It is the URL the code page is going to execute for you while on it. You may have some struggles with the way you have this set up though. It is hard to give good advice here as this is not the whole formula or idea. For example where is your "url" var used? On another note I would not name that var just url.

If this were me I would send the user to a code page and then have the code page execute the checking and unchecking of that particular record while verifying it got checked first before unchecking it. But that would require more JavaScript than the linked post shows. If you use Quickbase and just send the user via the api it may or may not work as anticipated based on how the URL you have above is formed. I am not sure it will work, but it might.