Forum Discussion

TeelinaHouse's avatar
TeelinaHouse
Qrew Trainee
5 years ago

I want ""Add Courses"" url link button to show when a checkbox is checked.

I want "Add Courses" url link button to show when a checkbox is checked. I am not a coder so here is what I have so far based on community posts - but not working. Help please - If[([Consists of Several Courses]), (URLRoot() & "db/" & [_DBID_CLIENT] & "?a=API_GenAddRecordForm&_fid_279=" & URLEncode ([Record ID#])& "&z=" & Rurl()

10 Replies

  • You need to have an "else" statement when using an If() statement.  So at the end of your URL you need a comma and two double-quotes followed by a closing parenthesis to close out the If() statement.

    If ( [Consists of Several Courses]=true,
    URLRoot() & "db/" & [_DBID_CLIENT] & "?a=API_GenAddRecordForm&_fid_279=" & URLEncode ([Record ID#])& "&z=" & Rurl()
    ,"" )
    • TeelinaHouse's avatar
      TeelinaHouse
      Qrew Trainee
      Hi, 

      I am not sure if in my updating I broke this or I never had the correct code to begin with. Let me re-ask my question. 

      When a checkbox is checked I want to show three lookup fields for additional information that is not needed normally.  This code is for adding a new record and I want the user to find and add an existing record.  It is similar to this help question https://community.quickbase.com/quickbase/topics/hiding-fields-when-box-is-checked; regarding, showing rows. I can't find the code for this example. 

      Thanks
    • LauraThacker's avatar
      LauraThacker
      Qrew Captain
      So, if I understand you correctly you have a checkbox on your form.  You want a set of 3 additional fields to display on the Form when the user checks the box because you need the user to enter 3 additional pieces of information that normally they do not enter.

      You will need a form rule that when the [checkbox] is true, show [field 1], show [field 2], show [field 3] (by default the alternative behavior is to hide these fields.

      If you need these fields to be displayed when they are populated; you can either leave the checkbox-checked on save; or modify the form rule to a multiple-conditions rule and have a second rule de-select the checkbox when the record is saved.

      You should then put your original formula back to this to create a new record in the Clients table.  If you need these additional 3 values to populate this new record, you will need to change the formula to include:

      URLRoot() & "db/" & [_DBID_CLIENT] & "?a=API_GenAddRecordForm&_fid_279=" & URLEncode ([Record ID#])
      & "&_fid_xxx=" & URLEncode ([Field 1])
      & "&_fid_xxxx=" & URLEncode ([Field 2])
      & "&_fid_xxxx=" & URLEncode ([Field 3])
      & "&z=" & Rurl()

      If none of this makes much sense, please call me and we can work through it together.  You can reach me at 626 771 0454.







    • TeelinaHouse's avatar
      TeelinaHouse
      Qrew Trainee
      Hi, Is there a way to screen share or show you the app?