Skip to main content
Question

Formula URL to Specific Form and Check off Checkbox field

  • May 28, 2019
  • 0 replies
  • 36 views

Hi,

I am trying to create a button that will drive to a different form on the same table and also check off a Checkbox field (field 324). I have tried several formulas, all coming up unsuccessful. Here is the latest I am working with: 

var text URL = URLRoot() & "db/" & [_DBID_OPPORTUNITIES]& "?act=API_EditRecord"
&"&rid=" & URLEncode([Record ID#])
& "&dfid=13"
&"&_fid_324=1"
& "&apptoken=" & "xxxxxxxxx";

"javascript:" &
"$.get('" & 
$URL & 
"',function(){" &
"location.reload(true);" &
"});" 
& "void(0);"

Help! What am I doing wrong? 
This topic has been closed for replies.

  • Quickbase Alumni
  • May 28, 2019
From a quick peak you don't officially open/close out the Javascript. Everything else for the most part looks fine. Update it like this (formatted for readability): 

"javascript: {" &
     "$.get('" & $URL & "',function(){" &
          "location.reload(true);" &
     "});" &
"}"

Notice you open the JS like javascript: {
and then close it out with a final }

Also as a note - remove the dfid=13 from the API call. Form ID references aren't needed in API calls

Chayce Duncan | Director of Strategic Solutions
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base

  • Author
  • Quickbase Alumni
  • May 28, 2019
Thanks! Looks like the function to check the checkbox worked, but I also need the button to drive to form ID 13 (not the main form for this table). How do i make that work? 


  • Quickbase Alumni
  • May 28, 2019
Instead of doing a location.reload() - set a window.location.replace to direct you to the form once committed

So change location.reload() to:

"window.location.replace('" URLRoot() & "db/" & [_DBID_OPPORTUNITIES]& "?a=dr&rid=" & [Record ID#] & "&dfid=13" & "');"

Chayce Duncan | Director of Strategic Solutions
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base

  • Author
  • Quickbase Alumni
  • May 28, 2019
Amazing, thank you!!