How do I create several buttons that each open different parts of the same form?

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • Answered
I have one form that contains lots of fields from various tables.  I want to be able to have 4 buttons (New Show, New Rental, New Community Event, New Film) that will each open certain fields depending on the button.  Much of the info needed for each type is the same so I didn't want to create different forms for each.  Thanks.
Photo of Tami Campos

Tami Campos

  • 90 Points 75 badge 2x thumb

Posted 5 months ago

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

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
I agree with having 1 form and using form rules.

In View mode you can use an API to check certain fields and then refresh the record.


var text URL = URLRoot() & "db/" & dbid() & "?act=API_EditRecord"
& "&_fid_100=0" // uncheck field ID 100
& "&_fid_101=1"; // check field ID 101


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

So the first part defines a formula variable called URL to edit some fields on the record, and then that javascript stuff simply run the URL and refreshes the page.  Don't worry that you do not understand the javascript stuff.  Almost "nobody does"  It just works.

The trick is to always call you formula variable URL and then use URL in the middle line in the javascript.

here is some help on formula variables if you have never used them

https://help.quickbase.com/user-assistance/formula_variables.html
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,522 Points 20k badge 2x thumb
>Don't worry that you do not understand the javascript stuff.  Almost "nobody does"  It just works.

I am launching a new program called Know Code™ as a remedial measure.
(Edited)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,346 Points 50k badge 2x thumb
I know it's your dream to have everyone know at least javascript 101.