web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

cannot read property 'Page' of undefined

(0) ShareShare
ReportReport
Posted on by 12

Hey guys,

I'm trying to get a TinyMCE rich text editor as a popup in my email form (the Alexander Development.net solution) working. Unfortunately I'm having trouble with catching the value of the email description (/body) into a variable this way:

var emailBody = parent.frames[0].Xrm.Page.getAttribute("description").getValue();

It returns this nice "Cannot read property 'Page' of undefined" error, while I was pretty sure this was the 2016 way of getting it done.
Since I'm not much of a javascript developer (obviously), I'm kind of stuck.

Anybody got a better idea or anyone knows how to get the description into the variable? It's building even before the popup is called, so I figured 'parent' would do the job (being the parent of the html web resource).. but clearly I'm wrong.

Any ideas?

thanks in advance!
Regards,

Jeroen

*This post is locked for comments

I have the same question (0)
  • Verified answer
    David Jennaway Profile Picture
    14,065 on at

    I think your problem is that there may be several frames within the parent object, whereas your code assumes that the email description is in the first one (frames[0]). Instead, try looping through each frame in turn, like below:

    var emailBody;
    for (var i=0;i<parent.frames.length;i++)
    {
     if (parent.frames[i].Xrm != null && parent.frames[i].Xrm.Page != null)
     {
      var ctl = parent.frames[i].Xrm.Page.getAttribute("description");
      if (ctl != null)
      {
       emailBody = ctl.getValue();
       break;
      }
     }
    }
    


  • Jeroen J Profile Picture
    12 on at

    Hey David,

    thanks for your quick reply! It worked as a charm!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans