Add URL button to mark checkbox, save, and close

  • 0
  • 1
  • Question
  • Updated 11 months ago
  • Answered
I'm trying to add a button to the form for table "A/R Payments". Ideally I would like to be able to click the button and have it check the box in my "Pmt Complete" field (fid=16) as well as save and close the record. Is this possible? I'm complete lost on the URL formulas (which I think is the way to go?).
Photo of TRNC

TRNC

  • 314 Points 250 badge 2x thumb

Posted 11 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,786 Points 50k badge 2x thumb
It is really difficult to have a button to both save and edit a record during the save.

It is really easy to make a button in View mode to check a box.

Here is an example of a formula URL button to be shown in View mode to check a checkbox and refresh the record.

var text URL = URLRoot() & "db/" & dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=xxxxxxxxxxxxxx"
& "&_fid_999=1;


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

The funky looking javascript stuff just executes the URL code and refreshes the page


Replace the 999 with the field ID of the field to be checked.
If you have the need for Application Tokens enabled in your Applications setting for Advanced Settings then you will need to supply an Application Token, or else you can disable that extra layer of security and then you would not need that line of code.
Photo of TRNC

TRNC

  • 314 Points 250 badge 2x thumb
Getting this error:

Formula syntax error

A variable declaration must end with a semi-colon.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,786 Points 50k badge 2x thumb
& "&_fid_999=1";

That line needed a closing "
Photo of TRNC

TRNC

  • 314 Points 250 badge 2x thumb
You are an absolute savior. Thank you so much!