Forum Discussion

DIPAPANCHALL's avatar
DIPAPANCHALL
Qrew Member
3 months ago

Embedded Reports New Form

Hello,

I currently use the new forms in QB, and I love the functionality to be able to easily add a record in that pop-up view when using an embedded report from another table. However, there is a limitation to this functionality of the parent record is not saved yet "adding a record". Is there a way I can let users add records to another table in an embedded report without the parent record being saved first? Or is there a way to trigger the save so that functionality can happen?

  • Interesting question.

    You can try this syntax as a formula rich text field.

    var text RID = If([Record ID#] > 0, ToText([Record ID#]), "%%rid%%");

    var text AddChild = URLRoot() & "db/" & [_DBID_CHILD] 
    & "?act=API_GenAddRecordForm" 
    & "&_fid_7=" & $RID;


    var text DisplayNewParent = URLRoot() & "db/" & [_DBID_PARENT] & "?a=dr&rid=";

    var text URL = 
    $AddChild
    & "&NextURL=" & URLEncode($DisplayNewParent) & $RID;

    "<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #4b7097; border-radius: 5px; color: #ffffff; display: inline-block; padding: 0px 0px 0px 0px; width:100px; text-align: center; text-shadow: none; border: 2px solid #030404; font-size: 12px \"href='"
    & $URL
    & "'>Save & Add Child</a>"

    //NOTE:  The %%RID%% does not seem to like being URLEncoded.

    // note: it seems to be ignoring the NextURL as it seems to land me back on the parent record in edit mode as opposed to view mode, when I use the button in add or in edit modes.