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

accessing Xrm.Page.data.entity.getId() inside a webresource

$
0
0

Hi

I have created a web resource (according to this sample: http://msdn.microsoft.com/en-us/library/gg309549.aspx ) and used it in a custom entity form, but I want to access 

Xrm.Page.data.entity.getId()

from my custom js file, but I got the following error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)
Timestamp: Mon, 13 May 2013 07:21:51 UTC


Message: 'Xrm.Page.data.entity' is null or not an object
Line: 4
Char: 4
Here is my js code:

$(function () {

   
   alert(Xrm.Page.data.entity.getEntityName());
   

});


Viewing all articles
Browse latest Browse all 8223

Trending Articles



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