Forum Discussion

JeffRohan's avatar
JeffRohan
Qrew Cadet
6 years ago

Button to save parent record and redirect to a child report

I tried to use this discussion thread:

https://community.quickbase.com/communities/community-home/digestviewer/viewthread?GroupId=103&MID=31362&CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804&tab=digestviewer#bmc59408cb-2abc-4bd8-94cf-e4e487fc7e7d

However, its does not answer my specific question.  

In parent table click New Record
in new (unsaved record) type in the Name of the Record
click on Button
Action expecting:
   save parent record
   in another tab open a report in the Child record

I tried:

var text GoToSection = URLRoot() & "db/" & [_DBID_SECTIONS] & "?a=q&qid=424";
var text ADD = URLRoot() & "db/" & [_DBID_FAMILIES] & "?act=API_GenAddRecordForm";
$ADD
& "&rdr=" & URLEncode($GoToSection)

Changing GotToSection to an actual https://quickbase. URL does not work so I can't use the target=_blank
NextURL instead of rdr does not work.  
I tried the "Open in a new window" field property but that cause the record to be sitting waiting to be saved.
I have tried every variation of this basic formula but after 5 hours I think this cannot be done.  However, it seems like a pretty basic thing to do. 

Any help is greatly appreciated.

Thanks

------------------------------
JeffR
------------------------------
  • On the Parent table (Settings > Advanced Settings), you should see an option "Save parent record automatically when a child record is created." Is that what you were looking for?

    ------------------------------
    Everett Patterson
    ------------------------------
    • JeffRohan's avatar
      JeffRohan
      Qrew Cadet
      Everett,

      Yes, I did click that option.  An Add type button that is generated by QuickBase when a relationship is created and uses the API_GenAddRecordForm api call will autosave the parent (when that option is clicked) and redirect to a child record form.  

      In this situation we are trying to save the parent record and then redirect to a report in another table (its probably misleading to specify that this is from parent to child).  

      The formula URL we use is trying to do this in 2 actions (API_GenRecordForm + Redirect).  However, the redirect to the the report should be done in a new tab in the browser.  I apologize for not writing the issue better, I had been trying to get this working for 5 hours and should have walked away from it and got a good nights sleep before writing the question in this forum.

      The issue is that the redirect (rdr and I also tried the NextURL) do not work in this situation. The operation generally works (saves record, and does display the report) but because the redirect does not work it replaces the browser window from the parent Form where the user clicks the button with the Report in the Child table.

      Thank you for responding

      ------------------------------
      Jeff Rohan
      ------------------------------
      • EverettPatterso's avatar
        EverettPatterso
        Qrew Captain
        Works for me, make sure you are using at least one _fid_# in the GenAddRecordForm, it's required

        var text GoToSection = URLRoot() & "db/" & [_DBID_REPORTS_PARENT] & "?a=q&qid=5";
        var text ADD = URLRoot() & "db/" & [_DBID_REPORTS] & "?act=API_GenAddRecordForm&_fid_6=Everett Patterson";
        $ADD
        & "&nexturl=" & URLEncode($GoToSection)​


        ------------------------------
        Everett Patterson
        ------------------------------