Monday, February 26, 2018

What things should we consider when choosing between CRM online or on Premise?


It is very important to know that what we should choose between MS CRM Online and MS CRM on premise. In this post we compare the two platforms, look at what is similar, and compare the differences.

The first and very important benefit of on premise we can see and modify CRM Server and SQL Server. Rest of the difference we will go through the below categories-

Storage:
            In case of online it is limited to amount of storage purchased, if you required more than the purchase you have to purchase it with additional cost.
            For on premise it is limited to amount of storage available on your server.

Workflows/Dialogs & custom entities:
            You can create only 200 workflows and 300 custom entities when you are using CRM online.
            In case of on premise there is no such limit to create workflow and custom entities.

Sandbox environments:
            CRM Online provides non production environments as part of your subscription that can be used for dev/test/UAT. The number of organizations received depends on the number of users.
Non production environments can be installed, depending on local server availability when you are using on premise.

Data Integration Options:
Integration options are similar between CRM online and On Premises. Third party integration tools like Scribe Insight and SSIS with Kingswaysoft work with both CRM On Premises and CRM Online.

Integration performance will vary based on the data loaded. Very large data integrations are typically faster with CRM on Premises if the integration server is close to the CRM server as latency is very low.
CRM Online integration performance can be improved by optimizing the integration, using the bulk load API, or by reducing latency to the cloud by running the integration from a Microsoft Azure server.

Mobility:
CRM clients for Tablet, Phone and outlook work exactly same between CRM online and on premise.

Extensibility:
Customizations developed in a supported way for CRM on premise can be moved to CRM Online (and vice versa), and plugins, workflows and any custom extension can be used in either Online or On Premises deployments. Any supported code will work in both CRM online and On Premises.

Migrating:

CRM Online customers can migrate On Premises at any time. SQL database provided to client at scheduled time that can be imported to an On Premises deployment.

CRM On Premises customers can migrate to CRM Online and customization for entities can be imported; however, on premises database cannot be moved to Online data center, so a data migration is required.

Friday, February 23, 2018

Where plugin Assembly get stored when get registered in MS CRM?



Recently I was looking for the answer for what happens when we develop any plugin and register it using the plug in registration tool and after few searches I easily found the below details about the same.
While registering plugin MS CRM provides tree options to where you want to plug in assembly deployed-
1.       Database: This is by default option as selected when you tries to register using plug in registration tool and also most commonly recommended and used. Because the get backed up with the database backup and get restored with database, no need to worry when deploying the organization while infrastructure change.
2.       Disk: When using this options it stores the plug in assembly under <crmwebroot>\server\bin\assembly
The Disk option is maintained mostly for backward compatibility with Microsoft Dynamics CRM 4.0.
3.       GAC : If your register your plugin assembly outside the Sandbox (meaning you are OnPremise) you can choose to deploy it to the GAC, in this case the advantage is that you take full advantage of the GACs versioning system, preventing conflicting versions of the same assembly if multiple versions are needed. The disadvantage is that the registration requires gacutil.exe and this can be an issue for some deployments.

In MSCRM all plugins related information like its name, content, createdBy, createdOn. ModifiedBy, ModifiedOn etc store in PluginAssemblybase Table. You can get it by below Query result :
select * from PluginAssemblyBase
Below are some column description of PluginBaseTable :

Column Name
Description
Name
Store name of Plugin
Source Type     
Where the Plugin registered
       0 -      Database
       1 -      Disk
       2 -      GAC
content
Store content of DLL


Thursday, February 22, 2018

Custom Code Validation Tool In MS CRM



What is Isolation Mode in CRM Plug-is in MS CRM


Sandbox: Isolated environment, also known as a sandbox, a plug-in or custom activity can make use of the full power of the Microsoft Dynamics CRM SDK to access the organization web service.
Access to the file system, system event log, certain network protocols, registry, and more is prevented in the sandbox.
It runs as a separate service, so it has got its own space to execute the process.
It has reduced functionality and a Partial Trust process
On-premise CRM will allow you to run plugins in or out of sandbox mode (none), whereas Online (Microsoft's hosted solution) will only run in sandbox mode
What are the Sandbox Limitations?
·         System event log
·         Certain network protocols
·         Registry
·         You cannot access any other DLL’s
·         You cannot call any web services from within a sandboxed plugin
·         IP addresses cannot be used
·         Only the HTTP and HTTPS protocols are allowed.
·         In isolated mode you cannot call any external DLL’s\DLL’s in the GAC
Some more restrictions are in listed below in detail-
·         Attempting to use the AppDomain.CurrentDomain.AssemblyResolve event
·         IO.Path.GetTempPath() [System.Security.Permissions.EnvironmentPermissionException]
·         Any filesystem access code [System.Security.Permissions.FileIOPermissionException]
·         Attempting to use the EventLog [System.Diagnostics.EventLogPermissionException]
·         Attempting to use IsolatedStorage [System.Security.Permissions.IsolatedStoragePermissionException]
·         Any references to Thread.CurrentThread caused a security failure.

Tuesday, February 13, 2018

Know your MS Dynamic CRM organization database name




While working in MS Dynamic CRM there can be a case when your database name is not similar to the organization name and sometime it’s difficult to find the correct database name which is pointing to the organization.

By running below query within MSCRM_CONFIG database we should be able to easily identify each organization:

SELECT [DatabaseName]
      ,[FriendlyName]
      ,[SqlServerName]
      ,[SrsUrl]
      ,[State]
      ,[UniqueName]
      ,[UrlName]
      ,[IsDeleted]
  FROM [MSCRM_CONFIG].[dbo].[Organization]


Web Resource Utility



During the development in MS CRM, manually creating Web resources one at a time using the customization tools can take a long time when developer have to create many files or even updating the existing web resource manually also a time consuming method. In our organization all the MS CRM project teams are doing the process manually.


We tried to find out the solution that,  is there any tool/utility which can help us to improve this process and found that there is a utility provided my Microsoft within latest CRM SDK which is “Web Resource Utility”, The utility is really very helpful in case of creating/updating multiple numbers of web resources with the proper configurations and only with the single click-

The Web Resource Utility sample project is included with the downloadable files for the SDK at SDK\Tools\WebResourceUtility.

We downloaded the latest SDK and tested the tool, we really found it very helpful and time saving, here is the screenshot of the utility  –




CRM REST Builder



In MS CRM 2016 while development we are using MS CRM Web API to manipulation of the data and creating the Web API requests to achieve the particular functionality,  to constructing Web API queries manually is time consuming, because most of the time we have to refer the Web API documentation.


To construct the Web API requests easily we well as quickly CRM REST Builder can help us.

CRM REST builder is provides a User Interface to create the API  requests where developer can just need select the required entities and the criteria for the same, CRM REST Builder creates Web API request based on it.


Please refer below screenshot of the CRM REST Builder.




There is a managed solution available on the below link to download for the CRM REST Builder –


Things to be consider while working with Date and Time related implementations in MS CRM


Recently we faced a lot of challenges while resolving date time related attributes issues in the one of our project MS CRM 2016 project.

Did some search on different forums and MSDN we found that, if we take care of the things which are recommended and different behavioral options provided by MS CRM for date time related functionalities, surely we will be confident about the implementations and avoid the iterative support issues in future.

Here we trying to list out few important points which developer should aware very well before implementing the date time related functionalities-

  1. CRM DateTime always comes with time component. There is a setting in creating a DateTime field that defines date only, but all that does is default the time to midnight local time
  2. DateTime is saved in database as UTC time.
3.       DateTime in CRM UI is always shown based on user’s local time zone. This is true even if UI is only showing the date component. This leads to following effect:
·         If user in CST enters  contact’s birthdate as 2/2/1980, this is saved as 2/2/1980 05:00 in DB
·         If user in PST views the contact record, he/she will see the birthdate as 2/1/1980 (because local time for the user will be 2/1/1980 22:00)
4.       DateTime retrieved through CRM Web Services is always UTC time
5.       DateTime set through CRM Web Services is user’s local time zone by default
·         Note that extra care must be taken to understand whether the call is done with the calling user or a service user
6.       DateTime set through CRM Web Services can be defined to be UTC instead
  1. DateTime queried directly from SQL table or base view returns UTC
  2. DateTime queried from filtered view returns users local time

Also we have found below mentioned valuable help related to the “Behavior and format of the date and time attribute in Microsoft Dynamics CRM” -

Sr. No.
Member name and value
Description
1
UserLocal
·         Stores the date and time value as UTC value in the system.
·         The retrieve operation returns the UTC value.
·         The update operation converts the UTC value to the current user’s time zone value, and then stores the updated value as is or as the equivalent UTC value depending on the kind (DateTimeKind) of the value specified for update. If the specified value is of UTC kind, it’s stored as is. Otherwise, the UTC-equivalent value is stored.
·         Retrieving the formatted value converts from UTC to the user’s current time zone based on the time zone and locale setting of the user.
·         For the OData endpoint, the attribute is exposed as DateTimeOffset.
·         This behavior is used for system attributes like CreatedOn and ModifiedOn, and cannot be changed. You should use this behavior for custom attributes where you want to store date and time values with the time zone information.

2
DateOnly
  • Stores the actual date value with the time value as 12:00 AM (00:00:00) in the system.
  • For the retrieve and update operations, no time zone conversion is performed, and the time value is always 12 AM (00:00:00).
  • Retrieving the formatted value displays the date value without any time zone conversion.
  • For the OData endpoint, the attribute is exposed as DateTimeOffset.
  • This behavior should be used for custom attributes that store birthdays and anniversaries, where the time information is not required.

3
TimeZoneIndependent
  • Stores the actual date and time values in the system regardless of the user time zone.
  • For the retrieve and update operations, no time zone conversion is performed, and actual date and time values are returned and updated respectively in the system regardless of the user time zone.
  • Retrieving the formatted value displays the date and time value (without any time zone conversion) based on the format as specified by the current user’s time zone and locale setting.
  • For the OData endpoint, the attribute is exposed as DateTimeOffset.
  • This behavior should be used for attributes that store information such as check in and check out time for hotels.


·         Note:
·          
·         The DateTimeAttributeMetadata.DateTimeBehavior property is available only if you are using Microsoft Dynamics CRM Online 2015 Update 1 or Microsoft Dynamics 365 (on-premises). Also, all date and time attributes in CRM Online 2015 Update 1 and Dynamics 365 (on-premises) now support values as early as 1/1/1753 12:00 AM.
·         For Dynamics 365 versions earlier than CRM Online 2015 Update 1 and Dynamics 365 (on-premises), you cannot define the behavior of the date and time values. By default, the date and time values are stored as UserLocal behavior as described later in this topic.
·          
Reference:


QueryExpression vs. FetchXML in MS CRM with C#

Microsoft Dynamics CRM (Customer Relationship Management) is a powerful platform that helps organizations streamline their business processe...