Forum Discussion

SalesInfo's avatar
SalesInfo
Qrew Assistant Captain
6 years ago

Create a button that once is clicked, the checkbox from another field is checked

I have a button that is linked to another table. I want another field, which is a checkbox, is checked once the button is clicked. Please see below for a formula of the button

URLRoot() & "db/" & [_DBID_HOME_DEPOT] & "?a=API_GenAddRecordForm&_fid_6=" & URLEncode ([Record ID#])& "&z=" & Rurl()

Please help
Thank you!

5 Replies

  • The code that you posted is a typical button to Add a child record to a Parent Record. Is the checkbox to be checked on the yet to be created child and you just want to prepopulate the field or do you want to check a box on the Parent Record.
    • SalesInfo's avatar
      SalesInfo
      Qrew Assistant Captain
      I want to check a box on the Parent Record, which is right next to the button. Once this is done, I'll create a rule which hides the button when the checkbox is checked.

      Thank you!
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      I can help you with that code, but I feel that a more solid solution would be to count the number of children in a summary field. On the relationship between the parent and this Home Depot Children. Then have a form rule to hide the add child button if the parent already has a child. [# of Home Depot] > 0

      The reason is that the user might start to add a child, but change their mind or have a power failure or be abducted by aliens just before that actually save the record. But then meanwhile that checkbox would already be checked.

      That form rule is popular also in China where I believe they still have the One child rule in effect for their population of 1 Billion..