URL formula button to open pop-up box to collect data

  • 0
  • 2
  • Question
  • Updated 2 years ago
  • Answered

I'd like to take a URL formula button which creates a new record and bring up a small window to collect a few fields of data which would then be written to the new record. Does anyone have any code for that?

Photo of Mark

Mark

  • 40 Points

Posted 4 years ago

  • 0
  • 2
no problem,

URLRoot() & "db/" & [_DBID_PROJECTS] & "?a=API_GenAddRecordForm"

Where I have [_DBID_PROJECTS] you would instead have the _DBID_ of your table - you get that from the Advanced properties of the table.

You can do do this

URLRoot() & "db/" & [_DBID_PROJECTS] & "?a=nwr"

Do you need to pre-populate any fields or are you looking to just pop up a blank form?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
M>no problem ... URLRoot()

I think the OP wanted a modal PopUp dialog not the opening of a new page. This example from June 19, 2011 demonstrated how you can create modal dialogs in the style of QuickBase's Popup (click on Test1 and Test2 buttons to demo):

MyPopDivs Not YourPopDivs
https://haversineconsulting.quickbase.com/db/bfuw7wt8a

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


Note that the code in the pastie and links points to the www subdomain not haversineconsulting as it was created before the great migration to UX2.
Photo of Mark Springthorpe

Mark Springthorpe

  • 126 Points 100 badge 2x thumb

Thanks Dan, much appreciated!


Photo of Sania

Sania

  • 478 Points 250 badge 2x thumb
Do you think this will work if on a click this model shows up and on it have all the required fields showing up to create a new child record and when I hit save, a new record is added to parent?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
Yes if you modify the script to meet your needs.
Photo of Sania

Sania

  • 478 Points 250 badge 2x thumb
What is "var csvData = "";" and the function followed by it doing? 
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
It is building up a string of csv data with newlines (ie \n) separating each line of data so that it can be posted to a table using API_ImportFromCSV.
Photo of Adam Keever

Adam Keever

  • 2,430 Points 2k badge 2x thumb
Can this be used in combination with jq-signature?

I would like to add a formula url button to forms so that on click
  • a signature canvas pops up with a save button
  • a signature is drawn with stylus, finger or mouse
  • on click of save button the signature canvas is either converted to a standard sized image of some sort and saved in an attachment field or is converted to a data string and stored in a url field
  • after save return to form with signature shown
Clicking the button again should allow for overwrite if the signer wants to redo.

Here is the jq-signature page that I have been studying:
http://bencentra.github.io/jq-signature/

And here is another page that uses js/jquery.signature.js:
http://keith-wood.name/signatureBasics.html
(Edited)
Juiced has an add on for this. http://www.juicedtech.com/add-ons/sig...
Photo of Adam Keever

Adam Keever

  • 2,430 Points 2k badge 2x thumb
Thanks. I am interested in the process of using a url button and code page.
I suggest contracting Dan Diebolt

https://community.quickbase.com/quick...

He has a working example in this thread.
Photo of Michael Frishman

Michael Frishman

  • 294 Points 250 badge 2x thumb
Dan, for the life I me I can't get "Test2" on "MyPopDivs Not YourPopDivs" to work, even in your example app. Test1 works fine, but not Test2.

Is the button formula really:

"javascript:var QBU_rid=" & [Record ID#] & ";" &
"$.getScript('https://www.quickbase.com/db/bfuw7wt8a?a=dbpage&pagename=Test2.js');void(0);

Sorry for being a java newbie
Photo of Kelly

Kelly

  • 1,902 Points 1k badge 2x thumb
I am using this for vehicle tracking. I have a table called 'Locations'. Every time the vehicle changes locations, I want to be able to click on this button, have it populate the date/time field, and open a new record that populates the related data. Is that possible?