Avdhut Vaidya
Avdhut Vaidya

Reputation: 334

Want to access "form_title_div" control in WebResource (js) in CRM 2011

I have an Entity in CRM-2011. I want to put up a small panel in the title of this entity. I am adding a webresource javascript file inside which i am trying to access the title bar of this entity.

What i have written is document.getElementById("form_title_div"). However, it is returning as NULL.

How can i access this title bar of the entity for any HTML activity from webresource javascript. Please assist

Upvotes: 0

Views: 120

Answers (1)

James Wood
James Wood

Reputation: 17552

This isn't the answer you probably want - you shouldn't do this, its not supported.

Do not access the DOM

JavaScript developers are used to interacting with Document Object Model (DOM) elements in code. You might use the window.getElementById method or the jQuery library. You are free to use these techniques in your HTML web resources, but they are not supported to access elements in Microsoft Dynamics CRM application pages or entity forms. Instead, access to entity form elements are exposed through the Xrm.Page object model. The Microsoft Dynamics CRM development team reserves the right to change how pages are composed, including the ID values for elements, so using the Xrm.Page object model protects your code from changes in how pages are implemented.

Upvotes: 2

Related Questions