Deprecated for 2016 and Dynamics 365 v9!
Why my code is not working in MS Dynamics CRM 2015 Update 1?
The details for the rendering are located at the following link:
Things that the new form rendering engine will break:
- Any attempt to access DOM in the content iframe using JS, jQuery or other 3rd party libraries (document.getElementById() or jQuery selectors)
- Creating a new HTML content in the parent window for persistent content (and assumed that the parent window was the main CRM iframe.
- Window.load, parsing iframe/form URL
- Attempting to use unsupported (non-XRM) APIs, especially undocumented ones that may have been shipped with CRM for internal usage only
- Accessing window.parent() from a web resource that may assume for example there’s a variable set in the current window context.
But how I can fix the issue with dynamically update Form Fields colours?
The details on the New Form Rendering Engine have a Fallback option, that will allow the old Form Rendering Engine to work with your code.
To use the old Form Rendering Engine you will need to update the System Settings in CRM.
Navigate to Settings -> Administration -> System Settings -> General
At the bottom of the form select “YES” under “Use legacy form rendering” and click OK button to save.
The next step will be to close your IE session and clear the cache on your browser.
Your code will continue working the same way in previous versions.
//// Update Field Label Colors document.getElementById("new_numbervalue_c").style.color = "White"; document.getElementById("new_numbervalue_c").style.backgroundColor = "#66CDAA"; //// Update Field Input Colors document.getElementById("new_numbervalue_i").style.color = "White"; document.getElementById("new_numbervalue_i").style.backgroundColor = "Red";
Hope this will help you understand the form rendering updates and new features in Microsoft Dynamics CRM 2015 Update 1 (SDK 7.1).
Get membership Access to all Content!
Get Access to the most updated content for Dynamics 365 and other technologies, receive emails when we post New Content and when we have new Videos, and Live Sessions! Subscribe to get our latest content by email. Also to get and download the source code on the new blog post!