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

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • Answered
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!
Photo of Sales Info

Sales Info

  • 818 Points 500 badge 2x thumb

Posted 5 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,914 Points 50k badge 2x thumb
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.
Photo of Sales Info

Sales Info

  • 818 Points 500 badge 2x thumb
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!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,914 Points 50k badge 2x thumb
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..
Photo of Sales Info

Sales Info

  • 818 Points 500 badge 2x thumb
 QuickBaseCoach App Dev./Training,

Can you please show me specific steps? 

Thank you!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,914 Points 50k badge 2x thumb
Go to the relationship between the parent and child and create a summary field to count the # of Home Depot Records.

Then create a Dynamic form rule using the tab on Customize this form to hide the add child button when that summary field is > 0