Forum Discussion

RhondaJones's avatar
Qrew Cadet
11 months ago

Lookup field not populating when using custom Save & new button

I have a child table that I needed to hide the native UI save button on. This is an EOTI app and unfortunately, EOTI seems to have a hard time following the simple direction of using the drop-down option on the save button to hit save and next if they need to enter more than one record. So I have to make "save and new" and "save and close" two large obvious buttons...

I am using this code 

"<a href='" & URLRoot() & "db/btcpg7sph?a=API_GenAddRecordForm&dfid=2&_fid_19=" & [Request - Name] & "&_fid_20=" & [Request - Order Number] & "'>\n    <img src='' alt='Save & New'>\n</a>"

I have double checked the field names and numbers and when I hit my button, the URL syntax is correct, it shows the Name and the correct Order Number. It just isn't generating in the form and because that is the field that actually links the record to the parent table, nothing entered on the form is saved.

Any help on what I am doing wrong?

Rhonda Jones

3 Replies

  • Can you tell us what the field is which relates the Children to the Parent?  ie what is your field name for [Related Parent] and is your formula populating it?

    Mark Shnier (Your Quickbase Coach)
  • Please make sure all fields used for this field (formulas) are visible in the form.

    Adam Krzyzanek
  • Hey Rhonda,

    It appears you are trying to set the lookup fields directly? Instead, you'll want to set the "reference" (foreign key) field in the relationship. Based on the word prepending the hyphen, in your case may be called Related Request? Once that field is set, the lookups should work as expected.

    Put another way, you'll need to grab the Record ID# from the context of the button click, which would then be used to set a field on your child table, so something like:

    // …
    // Are you trying to set lookups?
    // "&_fid_19=" & URLEncode ([Request - Name])
    // "&_fid_20=" & URLEncode ([Request - Order Number])
    // If so, instead set the Reference field
    "&_fid_xyz=" & URLEncode ([Record ID#])

    Also, I'd suggest wrapping your value in the URLEncode() function.

    Hopefully that helps!

    Brian Seymour