I am trying to call a function in SDK.MetaData.js from an HTML web resource and I am getting the following error:
JavaScript runtime error: Object doesn't support property or method 'getClientUrl'
It looks like the problem is inside this function. Xrm is undefined.
function _Context() {
var errorMessage ="Context is not available.";
if (typeof GetGlobalContext != "undefined")
{ return GetGlobalContext(); }
else {
if (typeof Xrm != "undefined") {
return Xrm.Page.context;
}
else
{ returnnew Error(errorMessage); }
}
};
I have already added the
<script src="../ClientGlobalContext.js.aspx" type="text/javascript"></script>
in my web resource.
Anybody ever faced this kind of a problem before?
Sachith Chandrasiri