0

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

James Wood
  • 17,286
  • 4
  • 46
  • 89
Avdhut Vaidya
  • 314
  • 2
  • 13

1 Answers1

2

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.

Community
  • 1
  • 1
James Wood
  • 17,286
  • 4
  • 46
  • 89
  • yes.. i accept your point.. however, in our case.. seems like we need a quick fix and doing the following wrks for mi as of now.. we will see for further upgrades.. though not particular about it - var divTag = document.parentWindow.document.getElementById("form_title_div"); – Avdhut Vaidya Jul 26 '16 at 08:16