Thursday, 15 February 2018

D365 CRM V9 - Plugin Registration tool connection error - Console App connection Error - TLS1.2


Wanted to pen down this for long time, but with latest info I have it made perfect sense to share with our community regarding the recent connection errors

What is the issue?
When we try to connect to D365 V9 from Plugin registration tool, the connection fails without any proper error and loops back to organization selection screen or login screen.


What is the root cause? TLS1.2 is used in D365 V9 and older versions are not supported!
 Well document root cause available here
Some more info around TLS1.2


Available Fixes:
There can be multiple fixes to this issue, simplest one is install the latest version if available but that not an option right now.

Fix1: Get the latest version my friend

The following fixes will also work with Console/SSRS report authoring Extensions

Fix 2

Note: Need Telerik Fiddler to be installed in the machine
  1. Open Fiddler
  2. Go to Tools in menubar => then select Options or Telerik Fiddler options 
  3. Open HTTPS Tab and look for the highlighted region in below image
  4. If it is missing TLS1.2, add the same by clicking it and save

Fix 3: Copied from Microsoft Article

  • Manually disable RC4 in TLS on systems running .NET Framework 3.5
    The following steps are primarily for customers running .NET Framework 3.5 on Windows 10 (or on Windows Server Technical Preview 3), for which an update is not available. However, for customer running .NET Framework 3.5 on all earlier affected operating systems, the manual steps serve as an optional alternative to installing the available update.
    Note These steps require the use of Registry Editor. Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or view the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe.
    1. Create a text file named strongcrypto35-enable.reg that contains the following text:
      For 32-bit applications on 32-bit systems and 64-bit applications on x64-based systems:
         [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727]
         "SchUseStrongCrypto"=dword:00000001
      
      For 32-bit applications on x64-based systems:
          [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727]
          "SchUseStrongCrypto"=dword:00000001
      
    2. Run regedit.exe.
    3. In Registry Editor, click the File menu and then click Import.
    4. Navigate to and select the strongcrypto35-enable.reg file that you created in the first step. (Note If your file is not listed where you expect it to be, ensure that it has not been automatically given a .txt file extension, or change the dialog’s file extension parameters to All Files).
    5. Click Open and then click OK
    6. Exit Registry Editor and restart the system.
  • Manually disable RC4 in TLS on systems running .NET Framework 4.5/4.5.1/4.5.2
    Despite the fact that an update is available for systems running .NET Framework 4.5/4.5.1/4.5.2, the following steps are primarily for customers with .NET Framework 4.5/4.5.1/4.5.2 applications running on systems with .NET Framework 4.6 present. For customers running only .NET Framework 4.5, 4.5.1, or 4.5.2, the manual steps serve as an optional alternative to installing the available update.
    Note These steps require the use of Registry Editor. Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or view the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe.
    1. Create a text file named strongcrypto4-enable.reg that contains the following text:
      For 32-bit applications on 32-bit systems and 64-bit applications on x64-based systems:
          HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319
          "SchUseStrongCrypto"=dword:00000001
      
      For 32-bit applications on x64-based systems:
          HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319
          "SchUseStrongCrypto"=dword:00000001
      
    2. Run regedit.exe.
    3. In Registry Editor, click the File menu and then click Import.
    4. Navigate to and select the strongcrypto4-enable.reg file that you created in the first step. (Note If your file is not listed where you expect it to be, ensure that it has not been automatically given a .txt file extension, or change the dialog’s file extension parameters to All Files).
    5. Click Open and then click OK
    6. Exit Registry Editor and restart the system.


Wednesday, 14 February 2018

D365 CRM V9 Troubleshooting TLS1.2 - SSRS report connectivity Error - Report Authoring Extensions

Recently I had to develop an FetchXML SSRS report and found that I was not able to connect to D365 CRM V9 from Visual studio. I have faced a similar issue with Plugin registration tool and the same was sorted with latest version of Visual Studio. But I couldn't find any latest version of Report authoring extensions. Planned to write a quick blog to help fellow developers

What is the issue?
When we try to connect to D365 V9 from visual studio using report authoring extensions, the connection fails without any proper error and loops back to organization selection screen or login screen.


What is the root cause? TLS1.2 is used in D365 V9 and older versions are not supported!
 Well document root cause available here
Some more info around TLS1.2

Available Fixes:
There can be multiple fixes to this issue, simplest one is install the latest version if available but that not an option right now.

The fixes will also work with Plugin registration tool/Console

Fix 1

Note: Need Telerik Fiddler to be installed in the machine
  1. Open Fiddler
  2. Go to Tools in menubar => then select Options or Telerik Fiddler options 
  3. Open HTTPS Tab and look for the highlighted region in below image
  4. If it is missing TLS1.2, add the same by clicking it and save

Fix 2: Copied from Microsoft Article

  • Manually disable RC4 in TLS on systems running .NET Framework 3.5
    The following steps are primarily for customers running .NET Framework 3.5 on Windows 10 (or on Windows Server Technical Preview 3), for which an update is not available. However, for customer running .NET Framework 3.5 on all earlier affected operating systems, the manual steps serve as an optional alternative to installing the available update.
    Note These steps require the use of Registry Editor. Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or view the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe.
    1. Create a text file named strongcrypto35-enable.reg that contains the following text:
      For 32-bit applications on 32-bit systems and 64-bit applications on x64-based systems:
         [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727]
         "SchUseStrongCrypto"=dword:00000001
      
      For 32-bit applications on x64-based systems:
          [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727]
          "SchUseStrongCrypto"=dword:00000001
      
    2. Run regedit.exe.
    3. In Registry Editor, click the File menu and then click Import.
    4. Navigate to and select the strongcrypto35-enable.reg file that you created in the first step. (Note If your file is not listed where you expect it to be, ensure that it has not been automatically given a .txt file extension, or change the dialog’s file extension parameters to All Files).
    5. Click Open and then click OK
    6. Exit Registry Editor and restart the system.
  • Manually disable RC4 in TLS on systems running .NET Framework 4.5/4.5.1/4.5.2
    Despite the fact that an update is available for systems running .NET Framework 4.5/4.5.1/4.5.2, the following steps are primarily for customers with .NET Framework 4.5/4.5.1/4.5.2 applications running on systems with .NET Framework 4.6 present. For customers running only .NET Framework 4.5, 4.5.1, or 4.5.2, the manual steps serve as an optional alternative to installing the available update.
    Note These steps require the use of Registry Editor. Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or view the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe.
    1. Create a text file named strongcrypto4-enable.reg that contains the following text:
      For 32-bit applications on 32-bit systems and 64-bit applications on x64-based systems:
          HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319
          "SchUseStrongCrypto"=dword:00000001
      
      For 32-bit applications on x64-based systems:
          HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319
          "SchUseStrongCrypto"=dword:00000001
      
    2. Run regedit.exe.
    3. In Registry Editor, click the File menu and then click Import.
    4. Navigate to and select the strongcrypto4-enable.reg file that you created in the first step. (Note If your file is not listed where you expect it to be, ensure that it has not been automatically given a .txt file extension, or change the dialog’s file extension parameters to All Files).
    5. Click Open and then click OK
    6. Exit Registry Editor and restart the system.


Monday, 12 February 2018

D365 CRM Basics - Understanding field types and their data types


Lets start with a basic concept of Dynamics CRM today, what are the different field types and field data types available and their basic definitions. To start with any field in dynamics falls under the below 3 categories(Except few OOB fields)

What are the types of fields/attributes I can create in D365 CRM?
  1. Simple field - Traditional field
  2. Calculated field - Based on formula and calculated on the go based on field in current record or related(lookup)
  3. Rollup field - Based on formula but used for aggregation from related records

Their handy definition from MS docs is as follows and the applicable field types types is as follow,

Field typeDescriptionAvailable field data type
Simple fieldContains data that is not based on a formula.Single Line of TextOption SetTwo OptionsImageWhole NumberFloating Point NumberDecimal NumberCurrencyMultiple Lines of TextDate and TimeLookup
Calculated fieldContains calculations that use fields from the current entity or related parent entities.Single Line of TextOption SetTwo OptionsWhole NumberDecimal NumberCurrencyDate and Time
Rollup fieldContains an aggregate value computed from the records related to a record, or a value computed over a hierarchy.Whole NumberDecimal NumberCurrencyDate and Time

What are the different data types available to configure?

D365 CRM supports wide range of data types and its better to understand all the available datatypes before settling down with one. If a field is created under certain data type, then field is locked for further data type swaps. Be wise before choosing one, else we may need to delete and recreate a field.

The field data types and their handy definitions from MS docs is as follows

Field data typeDescription
Single Line of TextThis field can contain up to 4,000 text characters. You can set the maximum length to be less than this. This field has several format options that will change the presentation of the text. These options are EmailTextText AreaURLTicker Symbol, and Phone. More information: More information: Single line of text format options
Multiple Lines of TextThis field can contain up to 1,048,576 text characters. You can set the maximum length to be less than this. When you add this field to a form, you can specify the size of the field.
Option SetThis field provides a set of options. Each option has a number value and label. When added to a form, this field displays a control for users to select only one option. When this field is displayed in Advanced Find, users can use a picklist control to select multiple options to include in their search criteria.
You can define a single, global option set and configure MultiSelect Option Set fields to use that single set of options. More information: More information: Creating and editing global option sets
MultiSelect Option SetThis field provides a set of options, where multiple options can be selected. When added to a form, this field uses a control for users to select multiple options. When this field is displayed in Advanced Find, users can select multiple options from the list to include in their search criteria.
You can define a single global option set and configure MultiSelect Option Set fields to use that single set of options. More information: More information: Creating and editing global option sets
Two OptionsThis field provides two options. Each option has a number value of 0 or 1 corresponding to a false or true value. Each option also has a label so that true or false values can be represented as “Yes” and “No”, “Hot” and “Cold”, “On” and “Off” or any pair of labels you want to display.

Two option fields don’t provide format options at the field level. But when you add one to the form you can choose to display them as radio buttons, a check box, or a select list.
StatusA system field that has options that generally correspond to active and inactive status. Some system attributes have additional options, but all custom attributes have only Active and Inactive status options.

You can also include custom state transitions to control which status options are available for certain entities. More information: Define status reason transitions
Status ReasonA system field that has options that provide additional detail about the Status field. Each option is associated with one of the available Status options. You can add and edit the options.
Whole NumberIntegers with a value between -2,147,483,648 and 2,147,483,647 can be in this field. You can restrict the maximum or minimum values in this range. This field has format options NoneDurationTime Zone, and Language that change depending on how the field is presented. More information: Whole number format options
Floating Point NumberUp to 5 decimal points of precision can be used for values between -100,000,000,000 and -100,000,000,000 can be in this field. You can specify the level of precision and the maximum and minimum values. More information: Using the right type of number
Decimal NumberUp to 10 decimal points of precision can be used for values between -100,000,000,000 and -100,000,000,000 can be in this field. You can specify the level of precision and the maximum and minimum values. More information: Using the right type of number
CurrencyMonetary values between -922,337,203,685,477 and 922,337,203,685,477 can be in this field. You can set a level of precision or choose to base the precision on a specific currency or a single standard precision used by the organization. More information: Using Currency Fields
Date and TimeThis field has format options to display Date Only or Date and Time.
ImageEach entity that supports images can have one image field. When an entity has an image field, it can be configured to display the image for the record in the application. More information: Image fieldsVideo: Dynamics CRM Image Data Type
LookupA field that allows setting a reference to a single record of a specific type of entity. Some system lookup fields behave differently. More information: Different types of lookups
OwnerA system lookup field that references the user or team that is assigned a user or team owned entity record.
Unique IdentifierA system field stores a globally unique identifier (GUID) value for each record.
CustomerA lookup field that you can use to specify a customer, which can be an account or contact.


Thursday, 11 January 2018

D365 V9 CRM SDK - SDK is reborn as Developer Guide - No more SDK download!


Microsoft is coming up with quite a bunch of sensible updates/features everyday. With the evolution around Dynamics space, we tend to witness updates around most of the existing areas and now it includes CRM SDK, 

What happened to SDK? No more SDK downloads!

SDK and the related documentations are replaced by Developer Guide . Developer Guide is a part of  docs.microsoft.com now and has all the needed documentation. 


Makes sense, but what happened to Plugin registration and other tools, bin assemblies and Sample code? 

Don't worry, Everything is still available but as standalone downloads


Where are the the plugin registration and other tools(Plugin registration tool, CrmSvcUtil, Configuration migration, Solution Packager, Package deployer, etc.,)

They are available as NuGet and can be downloaded using power shell scripts. The steps are as follows 

For more info refer this page from Microsoft docs and the below steps are copied from the same,

  1. In your Windows Start menu, type Windows Powershell and open it.
  2. Navigate to the folder you want to install the tools to. For example if you want to install them in a devtools folder on your D drive, type cd D:\devtools.
  3. Copy and paste the following PowerShell script into the PowerShell window and press Enter.
    $sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
    $targetNugetExe = ".\nuget.exe"
    Remove-Item .\Tools -Force -Recurse -ErrorAction Ignore
    Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe
    Set-Alias nuget $targetNugetExe -Scope Global -Verbose
    
    ##
    ##Download Plugin Registration Tool
    ##
    ./nuget install Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool -O .\Tools
    md .\Tools\PluginRegistration
    $prtFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool.'}
    move .\Tools\$prtFolder\tools\*.* .\Tools\PluginRegistration
    Remove-Item .\Tools\$prtFolder -Force -Recurse
    
    ##
    ##Download CoreTools
    ##
    ./nuget install  Microsoft.CrmSdk.CoreTools -O .\Tools
    md .\Tools\CoreTools
    $coreToolsFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.CoreTools.'}
    move .\Tools\$coreToolsFolder\content\bin\coretools\*.* .\Tools\CoreTools
    Remove-Item .\Tools\$coreToolsFolder -Force -Recurse
    
    ##
    ##Download Configuration Migration
    ##
    ./nuget install  Microsoft.CrmSdk.XrmTooling.ConfigurationMigration.Wpf -O .\Tools
    md .\Tools\ConfigurationMigration
    $configMigFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.XrmTooling.ConfigurationMigration.Wpf.'}
    move .\Tools\$configMigFolder\tools\*.* .\Tools\ConfigurationMigration
    Remove-Item .\Tools\$configMigFolder -Force -Recurse
    
    ##
    ##Download Package Deployer 
    ##
    ./nuget install  Microsoft.CrmSdk.XrmTooling.PackageDeployment.WPF -O .\Tools
    md .\Tools\PackageDeployment
    $pdFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.XrmTooling.PackageDeployment.Wpf.'}
    move .\Tools\$pdFolder\tools\*.* .\Tools\PackageDeployment
    Remove-Item .\Tools\$pdFolder -Force -Recurse
    
    ##
    ##Remove NuGet.exe
    ##
    Remove-Item nuget.exe    
    
  4. You will find the tools in the following folders:
  • [Your folder]\Tools\ConfigurationMigration
  • [Your folder]\Tools\CoreTools
  • [Your folder]\Tools\PackageDeployment
  • [Your folder]\Tools\PluginRegistration
To get the latest version of these tools, repeat these steps.


Where are the Sample codes and projects? 

They are available in the following Microsoft docs URL



Where are the assemblies? 

Assemblies are a part of NuGet package like the dev tools. Refer here for NuGet info


Hope this helps!

Source and Reference: Microsoft docs

Monday, 8 January 2018

{Know-How}MSCRM D365 JS - show or hide section using display name or label


Code Snippet to show or hide a Section using display name

Function to show or hide section


ToggleSection = function (tabName, sectionName, isVisible) {
    var tabs = Xrm.Page.ui.tabs.get();
    for (var i in tabs) {
        var tab = tabs[i];
        if (tab.getLabel() === tabName) {
            var sections = tab.sections.get();
            for (var s in sections) {
                var section = sections[s];
                if (section.getLabel() === sectionName) {
                    section.setVisible(isVisible);
                }
            }
        }
    }
};

Usage
ToggleSection("AdminTab","SectionName",false); //Hide
ToggleSection("AdminTab","sectionName",true); //Show

Note: The labels are case sensitive

{Know-How}MSCRM D365 JS - show or hide Tab using display name or label


Code Snippet to show or hide a Tab using display name

Function to show or hide Tabs


ToggleTab = function (tabName,isVisible) { 
    var tabs = Xrm.Page.ui.tabs.get();
    for (var i in tabs) {
        var tab = tabs[i];
        if (tab.getLabel() === tabName) {
            tab.setVisible(isVisible); 
        }
    }
};

Usage
ToggleTab("TabName",false); //Hide
ToggleTab("TabName",true); //Show

Note: The labels are case sensitive

Contact Form

Name

Email *

Message *