Discussions

Expand all | Collapse all

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

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

    Posted 08-17-2018 17:22
    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?


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

    Posted 08-17-2018 18:35
    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#])




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

    Posted 08-17-2018 18:44
    Alas, when you add a record,  you do not know the Record ID# until it gets created.  So I'm stumped on that one.



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

    Posted 08-17-2018 18:55
    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?


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

    Posted 08-20-2018 14:44
    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.


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

    Posted 08-20-2018 18:35
    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.