Forum Discussion

JacobJacob's avatar
JacobJacob
Qrew Cadet
8 years ago

Edit Parent Record In Popup and update Child record to show Edit

Hello,

Currently I have a button that opens a parent record in edit mode in a popup window where the user can make changes save and close out window without navigating away from child record.  Is there anyway to have this functionality still exist but also have it refresh the child record to show the new change on the parent level but on the child record form.  While I like the idea and functionality of the popup I would love to hear other ideas for easily editing a parent from the child record which is my basic problem I am trying to solve for.

Thanks.
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    On of the issues you might run into when you refresh the child record, is it will want to save any edits, so you will want to either save the child before the pop-up is opened, or only do this from view mode.

    The refresh will come with some html to to the affect of 

    {if (a.closed) {window.location.reload();}},500);\"
  • It is not clear to me if your reference to a "popup" is a new window or a dialog.

    If it is a new window you simple call the following when the new window unloads.

    window.opener.location.reload();

    If it is a dialog you just call the following when the dialog is dismissed:

    window.reload()
  • TateForgey's avatar
    TateForgey
    Qrew Assistant Captain
    I would love to see the code for the final button you ended up with.  I'm trying to do this exact same thing.  Thanks.