Forum Discussion

ArchiveUser's avatar
ArchiveUser
Qrew Captain
8 years ago

Add URL button to mark checkbox, save, and close

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?).
  • 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.
    • ArchiveUser's avatar
      ArchiveUser
      Qrew Captain
      Getting this error:

      Formula syntax error

      A variable declaration must end with a semi-colon.