How to access CRM entity Attributes in HTML Web resource in CRM 2013 RRS feed

  • Question

  • Hi Team,

    I added the html web resource to the form. I need to access entity attributes in the html web resource.

    I tried

    var title = window.parent.Xrm.Page.getAttribute("title").getValue();

    For everything it is returning [object object].

    Could anybody suggest How to do access entity attributes in html web resource.



    Friday, July 25, 2014 5:16 AM


All replies

  • Try,

    window.parent.Xrm.Page.data.entity.attributes.get("title").getValue() // assuming title is a text field

    Our Website| Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Friday, July 25, 2014 5:39 AM
  • Hi,

    It appears from your error that "title" is a lookup field. Use the following script to get the textual value in the lookup.

    var title = window.parent.Xrm.Page.getAttribute("title").getValue();
       title = title[0].name;

    Admin QuikView Solution for CRM 2013

    Friday, July 25, 2014 6:29 AM
  • Hi Sreenath:

    There is a bug that is fixed in SP1 UR1 that when you click on a HTML web resource after updating a field there was no lost/got focus events fired so the data in the field on the form was not forced into the entity so when accessed through XRM page the value would either be null or the previous value if it was an update.   Connect has a copy of UR1 for CRM 2013 SP1 in preview that this is fixed in - I would try that in your dev environment and see if this makes a difference.


    Friday, July 25, 2014 5:07 PM