Category Archives: CRM 2015

How to update CRM 2015 form field background color?

Why my code is not working in MS Dynamics CRM 2015 Update 1?

The past month we got a request to help migrate a customer from CRM 2011 to CRM 2015 Update 1, when working on the upgrade we encounter some custom code and particular dynamically form field color  changes using JavaScript, the code was correctly working on the previous version but when in the new upgraded version the solution stop working.

I notice when using IE Developer Tools the element Id was there but the JavaScript code always returns NULL value and the script was generating pop-up errors. I was looking for some issues on the javascript, used several ways to get to the element using JQuery and other 3rd party libraries, with no success.

In my effort to find a solution i review what was new on the new version CRM 2015 Update 1 (SDK 7.1) and find out that we have a new form rendering engine that was build for better performance and also  change the way manage javascript and 3rd party libraries.

The details for the rendering are located in the following link:

New Form Rendering Engine

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 colors?

The details on the New Form Rendering Engine have a Fallback options, 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.

CRM2015-LegacyFormRendering

 

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).

SOAPUI can’t load MS Dynamics CRM 2015 wsdl

SOAP UI and Microsoft Dynamics CRM 2015 have a lot new features and functionality, but when I was importing Microsoft Dynamics CRM WSDL in SOAP UI  keep giving me errors on the tool, and can’t  load the WSDL that microsoft dynamics CRM Organization service page provide.

Keep getting the following error messages:

Source: https://xxx.api.crm.dynamics.com/XRMServices/2011/OrganizationService.svc?wsdl
Error: type ‘DateTimeBehavior@http://schemas.microsoft.com/xrm/7.1/Metadata’ not found

Source: https://xxx.api.crm.dynamics.com/XRMServices/2011/OrganizationService.svc?wsdl
Error: type ‘ArrayOfEntityKeyMetadata@http://schemas.microsoft.com/xrm/7.1/Metadata’ not found

Source: https://xxx.api.crm.dynamics.com/XRMServices/2011/OrganizationService.svc?wsdl
Error: type ‘KeyAttributeCollection@http://schemas.microsoft.com/xrm/7.1/Metadata’ not found

The issues are related to the SDK Version for the WSDL, and the correct response from the Organization Service.

Resolution:
You need to specify the SDKVersion=7.1 and to get the full list for the WSDL with the value WSDL=wsdl0

The correct and full URL for the organization service that SOAP UI will be able to load is the following:
https://MYORGANIZATION.api.crm.dynamics.com/XRMServices/2011/OrganizationService.svc?wsdl=wsdl0&sdkversion=7.1

After adding those parameters to the url, SOAPUI will load all the missing or not found metadata elements and definitions, now you can create test connections .

Have fun with the new features in SOAP UI and Microsoft Dynamics CRM 2015.

Please leave your comments or questions regarding SOAP UI and CRM 2015.

CRMBuzz Power Tools Module Installation

The framework designed and developed for integration and connecting PowerShell automation and flexibility to Microsoft Dynamics CRM 2013/2015

The installation is been one of the most common questions on the use of the framework, these are step by step instructions on how to install and use the PowerShell tool.

 

        1. Open PowerShell
        2. type the following command, to let PowerShell use the most updated .Net framework version (required .Net 4.5.2)

          Reg Add HKLM\Software\Microsoft\.NetFramework /v OnlyUseLatestCLR /t REG_DWORD /d 1

          Reg Add HKLM\Software\wow6432node\Microsoft\.NetFramework /v OnlyUseLatestCLR /t REG_DWORD /d 1

        3. Unzip the zip file and create a folder where you will put the binaries, we will use by default the following c:\PowerShell\CRMBuzz
          CD\
          Md PowerShell
          cd PowerShell
          Md CRMBuzz
          cd CRMBuzz
        4. after unzipping the file and adding the files on the default folder, we will need to add 2 of the files to the GAC, using the following command.\gacutil.exe .\microsoft.crm.sdk.proxy.dll
          .\gacutil.exe .\microsoft.xrm.sdk.dll
        5. Close the PowerShell session, the next time you open a new PowerShell session will have these setting integrated.

Open a new PowerShell session and now you can use the following command to use the module

Import-Module .\CRMBuzz.PowerTools.PSSnapin.dll -Force -WarningAction SilentlyContinue -DisableNameChecking

To validate that the module is available to use, you can validate using the following command

Get-Command -pssnapin CRMBuzz.PowerTools.PSSnapin

Next blog post will have more information on the individual cmdlets included in the framework and how to used, also information on scripts the command is included.

please send your commends or questions.

Download the framework from the CRMBuzz PowerTools Codeplex location and also find the most updated in Github folder

Get the most updated Documentation Github CRMBuzz PowerTools Wiki

Abe.