Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Calling a function in SDK.MetaData.js from an HTML web resource and I am getting the following error

$
0
0

Hi,

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


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>