How do you pass a variable to a code page from a formula URL field?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I have a Customers table with  thousands of records and for any one record a user should be able to click a button to create multiple records in related table.  I do this with some JavaScript in an html page.  This works fine except now I need to link it to the Customers record so I want to pass my primary key field to the code page.  I first tried just tacking it onto the query string but that doesn't work.  I'm sure this is somehow possible I just can't figure out how to get the variable to the code page.

Photo of John

John

  • 0 Points

Posted 3 years ago

  • 0
  • 1
"javascript:var RID=" & [Record ID#] & ";" & "void($.getScript(' https://yourdomain.quickbase.com/db/yourappdbid/?a=dbpage&pagename=yourpage.js '))"
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,064 Points 20k badge 2x thumb
Place this code in a script tag within your html page:

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=480