locked
Save Parent Form RRS feed

  • Question

  • Hi,

    I am using ms crm 2011 rollup 13. I have to save the parent form on the save of child form. So, I have the following script enabled on save of child form but it does not work:

    It goes to else alert 2 and nothing happens.

    if ((window.top != null) && (window.top.opener != null) && (window.top.opener.parent != null) && (window.top.opener.parent.Xrm != null) && (window.top.opener.parent.Xrm.Page != null)) {
    alert("1");
    window.top.opener.parent.Xrm.Page.data.entity.save();
    }
    else if((window.parent != null) && (window.parent.opener != null) && (window.parent.opener.Xrm != null))
    {
    window.parent.opener.Xrm.Page.data.entity.save();
    alert("2");
    }

    I also tried these: None worked!

    window.parent.opener.Xrm.Page.data.entity.save();

    document.parentWindow.parent.Xrm.Page.data.entity.save();

    window.parent.Xrm.Page.data.entity.save();

    window.parent.opener.document.crmForm.Save();

    Friday, June 28, 2013 12:09 PM