On this page:
it explains just over half way down the page that Xrm.Page is deprecated.
Interestingly, it notes the following:
Although Xrm.Page is deprecated, parent.Xrm.Page will continue to work in case of HTML web resources embedded in forms as this is the only way to access the form context from the HTML web resource.
Note my underline above. I'm in the midst of an upgrade project from Dynamics v8 to v9 and need to get the form context for an HTML web resource. I was going to use parent.Xrm.Page but just before I did that I started to play about in dev tools for IE. It was here that I noticed I could do:
window.parent.constructExecutionContext().getFormContext();
I got the form context! Testing this out, the code worked perfectly.
To me this is a big deal but when I search online for any documentation or posts about constructExecutionContext() I get zero results.
Have we a bonafide way of obtaining the context and Microsoft have just forgot to mention it? Should Microsoft update the guidance in the web page above?
I'd like to verify that this is supported. Can we get someone from Microsoft to confirm?
EDIT: This post is not about the currently documented way to get the form context by using executionContext.getFormContext() but rather getting the form context from an HTML web resource using the, from what I can so far tell, the undocumented constructExecutionContext() method.