Forum Discussion

PaulPeterson1's avatar
PaulPeterson1
Qrew Assistant Captain
5 years ago

Conditionally check a checkbox

I've put in too many hours this week and am making stupid mistakes.  

I need a button that will check a checkbox if a corresponding checkbox is checked.  There are several services and not all are subscribed on each order.  Rather than checking a submit button for all services that have not been submitted I want to add a button that will check the submit button for any services that have not been submitted.

This is my first real attempt at a button and I am a bit blind.  

I am currently using:

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

If([Remote Services] and [Remote Services] != [Remote Services - Submit], $URLRemoteServices)

and getting the following error

<qdbapi>
<action>API_EditRecord </action>
<errcode>5</errcode>
<errtext>No Such Operation</errtext>
<errdetail>
This operation does not exist. Please check the URL.
</errdetail>
</qdbapi>

I only have the first service in the list added at the moment.  I will use the approach I saw in this post.

I hope one of you can point me in the right direction.


------------------------------
Paul Peterson
------------------------------
  • .... _fid_3008! man o man, that's a lot of fields.

     But I digress,

    Like Tom Hanks says "there is no crying in baseball"

    similarly, "There is no spaces in URLs"

    ?act=API_EditRecord & rid  // take out the spaces before and after the &




    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • PaulPeterson1's avatar
      PaulPeterson1
      Qrew Assistant Captain
      Thank you Mark,

      I removed the spaces and now getting this error:
      <qdbapi>
      <action>API_EditRecord</action>
      <errcode>0</errcode>
      <errtext>No error</errtext>
      <rid>200480</rid>
      <num_fields_changed>0</num_fields_changed>
      <update_id>1586982586971</update_id>
      </qdbapi>




      ------------------------------
      Paul Peterson
      ------------------------------
      • AdamKeever1's avatar
        AdamKeever1
        Qrew Commander
        You have to redirect if you don't want to land on the API response page. This isn't an error, but it did not change the checkbox to checked.

        What are the conditions you are trying to evaluate? I don't follow your conditional statement:

        "If([Remote Services] and [Remote Services] != [Remote Services - Submit], $URLRemoteServices)"

        Your first [Remote Services] call does not evaluate anything. I would expect something more along the lines of:

        If([Remote Services] = true and [Remote Services] != [Remote Services - Submit], $URLRemoteServices)

        ------------------------------
        Adam Keever
        ------------------------------