CRM 2011: Accessing the parent form from a child form

In CRM 4.0 developers sometimes needed to extract data from the parent form of a record opened from one of the associated views attached to the record.  A contact record opened from an Account would be a perfect example.

Well, CRM 2011’s JavaScript object model is slightly different so using the following technique doesn’t work:

window.opener.parent.document.crmForm;

The variations I located may resemble these:

  • window.opener.parent.document.crmForm
  • window.opener.document.crmForm
  • window.opener.parent.crmForm

 

Rhett Clinton and I ( along with input from others ), spent a great deal of time trying to figure this out but it was Rhett who finally made the breakthrough.

Here is how it is done within CRM 2011:

window.top.opener.parent.Xrm.Page

 

We’ve both added this scenario to our JavaScript conversion tools:

Leave a Reply 13 comments