Add a new record on a custom form AND view that record on the same custom form once the record is saved.

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • Answered
I have a magic button to add a new record in a specific form ' URLRoot() & "db/" & [DBID XXX] & "?a=API_GenAddRecordForm&_fid_21=" & URLEncode ([XXX]) & "&dfid=18".  It works to add the record, however when I save the new record I am taken to the default form.  How can I save and view the new record on the custom form - "dfid=18" in this case - instead of the default form?
Photo of Phil Pinkham

Phil Pinkham

  • 120 Points 100 badge 2x thumb
  • frustrated

Posted 4 months ago

  • 0
  • 1
You're half way there! You just need to specify the next url at the end of your formula.

URLRoot() & "db/" & [DBID XXX] & "?a=API_GenAddRecordForm&_fid_21=" & URLEncode ([XXX]) & "&dfid=18 &" & "nexturl=" & URLEncode(URLRoot() & "db/" & [DBID XXX] & "?a=dr&dfid=18&rid=" & [Record ID#])


Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,240 Points 50k badge 2x thumb
Alas, when you add a record,  you do not know the Record ID# until it gets created.  So I'm stumped on that one.

Ah, good point. The formula URL above was triggered off of an existing record, so it's actually just directing to that record and not the new one... 

I'll need to test a bit more.

@Phil Pinkham, where is your button located?
Photo of Phil Pinkham

Phil Pinkham

  • 120 Points 100 badge 2x thumb
The button is located on the form of the parent record.  That "nexturl=" parameter is something I was not aware of.  I'd used "&rdr=" before in other use cases, but that opens up a lot of possibilities. Thanks!  That is a big help in and of itself beyond this specific issue.
That's great! I think you may need to use the nexturl to direct to a page or report vs back to the new record... at a minimum they wont end up on the wrong from.

Or in the case of the formula I provided above, you could back to the parent record by using its DBID.
(Edited)