Discussions

 View Only
  • 1.  Add URL button to mark checkbox, save, and close

    Posted 01-04-2018 15:07
    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?).


  • 2.  RE: Add URL button to mark checkbox, save, and close

    Posted 01-04-2018 15:32
    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.


  • 3.  RE: Add URL button to mark checkbox, save, and close

    Posted 01-04-2018 15:40
    Getting this error:

    Formula syntax error

    A variable declaration must end with a semi-colon.


  • 4.  RE: Add URL button to mark checkbox, save, and close

    Posted 01-04-2018 15:41
    & "&_fid_999=1";

    That line needed a closing


  • 5.  RE: Add URL button to mark checkbox, save, and close

    Posted 01-04-2018 15:44
    You are an absolute savior. Thank you so much!