Thursday 15 February 2018

D365 CRM V9 - Plugin Registration tool/SSRS/XRMToolbox 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 of TLS 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 of Plugin Registration Tool my friend

The following fixes will also work with Console App/SSRS report authoring Extensions and I prefer the registry fix which seems permanent. Somehow XRMToolbox works only with registry fix.

Fix 2:This works only when fiddler is running(Temp Fix)

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(Suggested fix - Needs Machine Restart)

  • 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/XRMtoolbox

Fix 1: This works only when fiddler is running

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(Suggested fix)

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