Forum Discussion

JustinPauga's avatar
JustinPauga
Qrew Cadet
7 years ago

URL Button to check a checkbox

I am trying to have a URL Button to check a checkbox if that checkbox is empty and do nothing if it is already checked. I would also like this button to be pressed from an embedded report.
Essentially, I have an Items table that is embedded into an estimate table. The items have the name, description, price and whether it is approved or not. The approved checkbox is unchecked until the customer decides they want to move forward with that line item so I need a button that can be pushed from the embedded report that will check the approved box and update the item
  • Justin, I see that you found my app in the Exchange

    Here is what you need


    var text URL =
    URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_55=1";

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

    Change 55 to your checkbox fid.

    this syntax refreshes the whole page, even when clicked off a child record on an embedded report on form,  or on a report.
    • KristenBrown__s's avatar
      KristenBrown__s
      Qrew Member

      Hello, is there an update to this code given the changes with javascript?



      ------------------------------
      Kristen Brown (she/her)
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

        Here is an example

        var text Approve = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#])
        & "&_fid_144=Approved";

        var text RefreshPage =  URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();

         
        $Approve
        & "&rdr=" & URLEncode($RefreshPage)



        ------------------------------
        Mark Shnier (Your Quickbase Coach)
        mark.shnier@gmail.com
        ------------------------------
    • RaviSiddana's avatar
      RaviSiddana
      Qrew Trainee
      Hi,

      I have the same requirement. I have been using the script in a "formula URL" field. However its not working. Could you please help me?

      Regards,
      Ravi

      ------------------------------
      Ravi Siddana
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        Can you explain what you want the button to do and post your current code which is not working?

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      :) As far as I know the only resource is scraping answers off this forum and saving them.  I have an app with a table where I save all my favorite tricks.  The only other possible resource is if any of the Quick Base university videos cover it.

      If you just want to use the easy javascript,  It's basically that code you are using to refresh the page along with this one below which will do the edit, but will not refresh the page.  Some times you do not want to refresh the page as it delays the next click and jiggles the screen around on the user, when they have multiple clicks to do.



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

      "javascript:" &
      "$.get('" & 
      $url & 
      "',function(){" &
      "$.jGrowl('This Item has been put on PO CANCEL snooze', {life: 5000, theme: 'jGrowl-green'});" &
      "});" &
      "void(0);
  • I was able to figure out how to do it using quickbases URL Formula Buttons for Dummies sample app but right now it redirects back to that line item and I need it to either not redirect or to redirect back to the related estimate