Wednesday, January 16, 2013

How to Query Xrm page context from an HTML web resourc

Since the webresource is essentially a child of the CRM page, you can access it using Parent:
This is a standard web resource embedded into a CRM form:

<HTML>
  <HEAD>
    <TITLE>HTML Web Resource</TITLE>
  </HEAD>
  <BODY onload="window.status='It\'s a wild ride';" contentEditable=true>
    <SCRIPT type=text/javascript>
      var firstname = parent.window.Xrm.Page.getAttribute('firstname').getValue()
      document.write("Hello "+ firstname);
    </SCRIPT>
  </BODY>
</HTML>

No comments:

Post a Comment