I've an HTML web resource in Dynamics CRM on-premise environment. It is saved as new_htmlpage1
, now at a click of Custom button I'm opening this HTML
web resource. I've added ClientGlobalContext.js.aspx
as reference in HTML webresource as well. But still I am receiving error that GetGlobalContext is not defined
Below is my HTML source code.
<html>
<head>
<script src="../ClientGlobalContext.js.aspx" type="text/javascript"></script>
<script type="text/javascript">
function tempContext(){
if (typeof GetGlobalContext != "undefined") {
var userName = Xrm.Page.context.getUserName();
alert(userName);
return;
}
}
</script>
</head>
<body onload="tempContext()">
</body>
</html>
Here is the walkthrough from Microsoft that I am following, but still unable to get GlobalContext.
Please let me know what I am missing here.