Sonoma Partners Microsoft CRM and Salesforce Blog

These Aren’t the 4.0 API Functions You’re Looking For

With the release of Dynamics CRM 2013, Microsoft has provided a handy Custom Code Validation tool to help detect potential upgrade issues with your HTML and JavaScript web resources.  This tool will help identify any calls using the CRM 4.0 client SDK, 2007 endpoints, and any unsupported DOM manipulations.  It pulls in all the web resources in your organization so you can easily select them and it’ll spit out a nice list of issues or potential issues.

image

While this tool is a great start to help finding potential issues, we noticed a lot of false positives when using it on some of our JavaScript frameworks.  For example, the tool searches scripts for “.Lookup” as it is a property that is no longer supported on native 2013 Lookup controls.  The issue is that our script references our own property “.LookupOptions” which is flagged in the validation tool as you can see below.  This also happens for several other properties.

newColumn.controlOptions = new SP.Controls.LookupOptions();

Along with searching native deprecated properties, the validation tool also searches for potential cross browser issues.  One issue is if you use the method selectSingleNode as it is not supported in browsers other than IE.  We have our own implementation of selectSingleNode for the same reason which this validation tool flags as a potential issue.

var entityMetadata = _getEntityMetadata(Sonoma.Xml.selectSingleNode(xmlDocument, "//b:value"));

There are a few more things to consider.  This tool does not search for getServerUrl or getAuthenticationHeader methods which have been deprecated in CRM 2011 since UR 12 and will most likely be removed in CRM 2013.  Also, it is worth noting that it does not check Silverlight web resources.  Any calling of 4.0 endpoints or unsupported JavaScript within your Silverlight web resources will not be flagged.

Overall, this tool is highly recommended as a good start to analyzing your web resources before an upgrade to CRM 2013.  The caveat is to review the output thoroughly to eliminate some of these false positives that could potentially mislead you in your upgrade effort.

Topics: Microsoft Dynamics CRM 2013

Multi-Threading Your SSIS CRM Integration for Performance

Today’s guest bloggers are Rob Jasinski, a Database Architect at Sonoma Partners, and Angel Shishkov, a Senior Developer at Sonoma Partners.

Recently, we were tasked with migrating millions of activities into a CRM Online organization. The challenge was we had a small time window to get this done. Since this was an online environment we had to migrate the data via the normal API and, as you may know from experience, this can be time consuming on a large amount of data.

We decided to create an SSIS package using SQL 2008 R2 to utilize the native data transformation tools available in the process. The data source was just straight SQL from a SQL Server database. The destination, in this case, was a third party component from KingswaySoft, but it could be any other third party CRM component or custom code via the native Script Component. The process looked similar to the figure below.

image

The problem with this process was there was a bottleneck at the destination, since it was retrieving the data via direct SQL, which is very fast, but inserting the data via CRM API calls, so it couldn’t keep up with the rate at which the data was being retrieved. The solution was the Balanced Data Distributor (available from the link below) from Microsoft.

http://www.microsoft.com/en-us/download/details.aspx?id=4123

This is an add-on SSIS component and “takes a single input and distributes the incoming rows to one or more outputs uniformly via multithreading.” We then took the output from the Copy transformation and split it out across 4 destination components (see figure below), which then almost tripled our overall throughput. For each destination you add, you will see diminishing returns, so you’ll need to do your own testing as to what the sweet spot is for your specific migration and environment. Also, please remember, all 4 components are the same, so if you make any changes to one you’d need to make the same change to all of them, so it might be a good idea to not split this until near the end of the development and testing cycle.

image

There are also some SSIS configuration changes that might have to be made in order to take advantage of these extra connection. In running in release mode, we added the following inside the <configuration> section of the DtsHost.exe.config file:

<system.net>
      <settings>
            <servicePointManager expect100Continue="false" />
      </settings>
      <connectionManagement>
            <add address="*" maxconnection="100"/>
      </connectionManagement>
</system.net>

 

The Expect100Continue setting turns off part of the web request handshake when sending data to CRM, which saves us one round-trip to the server. It is fairly minimal, but adds up if you are doing millions of requests and it’s free.

The MaxConnection setting is required to override the .NET MaxConnection default of 2 connections. Without it, the SSIS package will be limited to 2 concurrent outgoing connections.

Topics: Microsoft Dynamics CRM Microsoft Dynamics CRM 2011

Get a Head Start with the CRM 2013 SDK and Implementation Guide!

Microsoft just released the CRM 2013 SDK which includes some great topics and sample code on the new features coming in CRM 2013.  The SDK is a great start to get some insight on these new features.  I highly recommend checking it out as there are some brand new features, such as Custom Actions (which we will be covering in a later post), that I feel will be very powerful for developers to utilize.

Along with the SDK, the CRM 2013 Implementation Guide was also released.  The implementation guide is complete with the following detailed documents on a range of implementation topics:

  • Administration
  • Customization
  • Installing
  • Operation and Maintenance
  • Planning
  • Report Writers

The SDK articles don’t appear to be live on MSDN yet so below I listed out the topics in the “What’s New for Developers” section.  Over the next few weeks we will be posting about these topics in more detail so be sure to check back!

 

Entity images

Certain system entities and all custom entities can be enabled to display images in the application. People using the web application can upload images for entity records. For more information, see Entity Images.

Access teams

The Access Team is a new type of the team that doesn’t own records, but, has access to records. Unlike with owner teams, you can create any number of access teams to work on the same records and have team members with different levels of access rights to the record. More information: Use teams to collaborate and share information.

Business process flow

The Business Process Flow is a new type of the process (workflow) for creating visualizations to guide users through various phases of business processes. Each phase can contain a number of logical steps that have to be completed before a user can move to the next phase. You can customize the business process flow by adding or removing steps, changing the order phases, or adding new entities to the process flow. More information: Model business process flows, and Enable Entity Capabilities.

Real-time workflows

The existing workflow execution model that supports asynchronous workflows has been extended to support real-time (synchronous) workflows. Real-time workflows are not queued, as was the case with asynchronous workflows, but execute immediately on-demand or in response to a message being processed by the execution pipeline. Real-time workflows can optionally participate in the database transaction and perform similar functionality to plug-ins, yet can be created by the end user through the web application workflow designer. Developers can create real-time workflow through code. In addition, real-time workflows provide the core processing functionality of actions. For more information about real-time workflows, see Create real-time workflows.

Custom actions

Developers can extend the functionality of the standard Microsoft Dynamics CRM system by creating custom messages, with associated request/response classes, known as actions. These actions are available to business applications through web service calls. Typical use of actions is to add new functionality to organization web service or to combine multiple organization web service message requests into a single request. For more information about actions, see Create your own actions.

Mobile and rich client development

The OData service endpoint has been enhanced with the addition of authentication support for external mobile and rich client applications. Previously, the OData service endpoint supported only pre-authorized client (script) code provided in web resources. Once an authentication token has been obtained from the OData endpoint, client applications can use that token when sending SOAP based requests to the web services. For more information about the new authentication capability, see Authenticate the user with the web services. For information about mobile application development, see Write mobile and modern apps.

Data encryption

Field level data encryption provides higher security for sensitive data, for example passwords stored in an entity record of Microsoft Dynamics CRM. For more information, see Field-level data encryption.

Solution version compatibility changes

Starting with this release, solutions exported from a newer version of Microsoft Dynamics CRM cannot be installed into older versions. This includes major/minor version differences. For more information see Version compatibility.

Asynchronous solution import

The new ExecuteAsyncRequest message supports importing solutions, which is a long running operation, as an asynchronous process. This enables improved interactivity for users that are working in an organization during the same time that a solution is being imported. For more information see Execute messages in the background.

Quick start for developers

New documentation has been added that provides an easier and faster learning experience for developers or non-developers new to Microsoft Dynamics CRM technologies. For more information see Quick start to managed code application development.

Read-optimized forms removed

Read-optimized forms were a feature that allowed for forms that were optimized for consumption of data. For more information, see the Read-Optimized Forms topic in the in the Microsoft Dynamics CRM 2011 SDK.

Duplicate detection not supported during record create and update in forms

Duplicate detection during create and update using the new forms is not included for entities with the updated user interface. Duplicate detection of individual records won’t be supported for custom entities as well. However, to detect duplicates in bulk, you can use the BulkDetectDuplicatesRequest message and the RetrieveDuplicatesRequest message.

This functionality can be added by using client scripts and web resources. You can find an example showing how to do this in the following location in the SDK download: SampleCode\JS\DuplicateDetection. Download the Microsoft Dynamics CRM SDK package.
More information: Detect duplicate data

Phone number formatting for String attributes

String attributes can be formatted to allow click-to-call using Lync or Skype. Adding this capability required the addition of a new FormatName property to the StringAttributeMetadata class and the addition of a StringFormatName class containing members to set valid values. For more information see StringAttributeMetadata formats.

New form programming methods and event

There are new form APIs included in this release. More information: New form programming methods and event.

AttributeMetadata.AttributeTypeName replaces AttributeMetadata.AttributeType

AttributeMetadata.AttributeType has been deprecated in favor of the new AttributeMetadata.AttributeTypeName property. This new property returns members from the AttributeTypeDisplayName class.

This change was necessary to support the new ImageAttributeMetadata class. The AttributeType value for this class will return AttributeTypeCode.Virtual because there is no value in the AttributeTypeCode enumeration to describe this type. Use AttributeMetadata.AttributeTypeName to retrieve values that correctly identify all types of attributes.

Topics: Microsoft Dynamics CRM 2013

CRM 2013 Composite Controls

With the release of CRM 2013, Microsoft will be adding new Composite Controls for fields associated to Name and Address.  Composite Controls are simply a concatenation of multiple attributes that are displayed in one field.  The field can then be edited through a flyout that slides open when a Composite Control field is clicked on.

As you can see below, the Full Name field on the Contact form is one field and when I hover over it, it changes display letting me know that I can edit the field.

image 

Once the field is clicked on, a flyout opens that allows me to edit any of the fields that make up the Full Name field (First Name, Middle Name, and Last Name).

image 

Similarly, if I try to edit the Address field, a flyout will open and allow me to edit any of the fields that make up the Address field.

image 

One thing to note is that only Name and Address fields can have Composite Controls.  On the plus side, the client-side SDK or the new Business Rules can be ran against Composite Control fields.

Let us know your thoughts on the new Composite Control in the comments section and check back soon for more CRM 2013 coverage!

Topics: Microsoft Dynamics CRM 2013

CRM 2013 New Client API Methods

With CRM 2013, Microsoft is providing some exciting new methods we can use with the JavaScript SDK on the entity forms.  Some highlights are an easier way to set the form dirty, custom lookup filters, and a supported way to display form notifications as well as field specific notifications.  See below for a full comprehensive list with details.

Context

  • Xrm.Page.context.client.getClient()
    • Returns “Outlook”, “Web”, or “Mobile”
  • Xrm.Page.context.client.getClientState()
    • Returns “Online” or “Offline”
    • Xrm.Page.context.isOutlookOnline and isOutlookClient are now deprecated

Data

  • Xrm.Page.data.refresh()
    • Asynchronously refresh data on form without reloading the page
    • Can pass in a callback to execute on error or success
  • Xrm.Page.data.save()
    • Asynchronously save the form
    • Can pass in a callback to execute on error or success
  • Xrm.Page.data.getIsValid()
    • Returns a boolean telling whether the form can be saved or not
  • Xrm.Page.data.setFormDirty()
    • Sets the form as dirty

Entity

  • Xrm.Page.data.entity.getPrimaryAttributeValue()
    • Returns a string value of the primary attribute for the entity

UI

  • Xrm.Page.ui.setFormNotification()
    • Takes in a string value to set a form notification with the passed in string
    • Pass in “ERROR”, “INFORMATION” or “WARNING” to dictate the type of notification

image 

  • Xrm.Page.ui.clearFormNotification()
    • Clears the form notification

All Controls

  • Xrm.Page.getControl("new_name").setNotification("Field specific notification")
    • Sets a notification specific to the field

image

  • Xrm.Page.getControl(“new_name”).clearNotification()
    • Clears the field specific notification

Number Fields

  • Xrm.Page.getAttribute("new_precision").setPrecision(2)
    • Override field’s precision

Date Fields

  • Xrm.Page.getControl("createdon").setShowTime(true)
    • Controls whether to show the time for a date field

Lookup Fields

  • Xrm.Page.getControl("ownerid").addCustomFilter(fetchFilter, entityType)
    • Applies a custom filter to the lookup view
    • entityType is optional and if it is not passed it will default to all entity views
  • Xrm.Page.getControl("ownerid").addPreSearch(handler)
    • triggers right before a lookup dialog pops open
  • Xrm.Page.getControl("ownerid").removePreSearch(handler)
    • removes event handler set from the addPreSearch method

Utility

  • Xrm.Utility.openWebResourceDialog(webResourceName, webResourceData, width, height)
    • opens a specified HTML web resource as a dialog
Topics: Microsoft Dynamics CRM 2013

Sneak Peek at CRM 2013 Lookups

In CRM 2013 the UI is getting a nice makeover to a flatter, faster and less clicky design.  This means there will be some improvements made to the lookup control as well. 

Below is an example of the Primary Contact lookup on the account form.  When the magnifying glass is clicked to select a record, a nice inline box drops down below the lookup control to let you quickly select a record without needing a popup.

image

Clicking the “New” button at the bottom right in the inline box will display the new Quick Create form shown below.  The Quick Create form is a new type of form in CRM 2013 that will slide down from the top of the page and allow the user to easily see the information needed to quickly create a new record.  When all the required fields are filled out and save is clicked, the new record will be automatically selected in the lookup control.

image

If the record you are looking for doesn’t show up in the inline box of the lookup control, you can click “Look Up More Records”.  This will display a dialog that is similar to CRM 2011 which will allow you to add more search filters and choose from a big list of records.

image

When the “New” button is clicked on this dialog, it will open a create form in another window, just like CRM 2011.

There you have it.  We’re very excited about the UI enhancements coming with 2013.  We think it will address a lot of complaints about a clicky design that CRM 2011 currently has.  Stay tuned for more posts about upcoming CRM 2013 features and enhancements!

Topics: Microsoft Dynamics CRM 2013

Am I Ready for CRM 2013?

Today’s guest blogger is Jacob Cynamon-Murphy, a Sales Engineer at Sonoma Partners.

It's coming.  The next release of Microsoft Dynamics CRM.  Codename: Orion.  Official name: Microsoft Dynamics CRM 2013.  Are you ready?

With some legacy features being removed from Dynamics CRM - most prominent among them CRM 4.0 JavaScript APIs and .NET web services - it's our goal to give you straightforward guidance to help you get your CRM system in shape for the upgrade process.  In an effort to help our customers be proactive in their preparation, we have prepared a flow chart that you can use to determine how ready your CRM customizations are for upgrade to CRM 2013.

Key things to note:

  • There will be revised software requirements for CRM 2013 on-premises deployments, but these requirements are not yet public.  Because of this, we are not including them on the flow chart.
  • The Legacy Feature Check Tool, called out as (1) in the diagram, is available for download.  You can run it against your CRM 2011 instance to find out changes you need to make to your server-side code.  It may not detect infrequently executed components, like command-line apps, but it's a great start to help you find and upgrade legacy code.  It is also slated to execute as part of the organization upgrade process when you undergo a CRM 2013 upgrade.
  • Microsoft has posted the Custom Code Validation Tool for Microsoft Dynamics CRM 2013 for download.  Noted as (2) in the flow chart, this tool will examine your JavaScript web resources for code that is either a) incompatible with cross-browser support or b) uses the old CRM 4.0 script API, which is going away in CRM 2013.

 

clip_image002

Following the upgrade, we strongly advise adapting your system to take advantage of some of the powerful new capabilities in Dynamics CRM 2013, like business process flows, portable business logic, and quick view forms, to name a few.  We'll discuss these new features in depth in future blog posts.  We'll also address the broader concern of organizational readiness.

If you find this to be a bit overwhelming, we can help you get from the start to the finish easily and without frustration.  Contact us at Sonoma Partners and we'll help you navigate the upgrade process.

Topics: Microsoft Dynamics CRM Microsoft Dynamics CRM 2013

CRM 2013 Form and Field Notifications

One of the many new features coming in CRM 2013 is the ability to dynamically display form and field specific notifications.  In CRM 2011 it was possible to leverage the form notifications using unsupported JavaScript but now in CRM 2013 there is a handy client-side method for this.  There are three different types of form notifications, error, information and warning which will determine the type of icon that is shown with the notification.  Below are examples of the new client-side methods and what it will look like on the new 2013 form.

Form Notification

Xrm.Page.ui.setFormNotification(“Form notification”)

  • Takes in a string value to set a form notification with the passed in string
  • Pass in “ERROR”, “INFORMATION” or “WARNING” to dictate the type of notification

image

To get rid of the form notification:

Xrm.Page.ui.clearFormNotification()

Field Notification

In addition to form notifications, CRM 2013 will add field specific notifications.  This is helpful if you have fields that will be dynamically required.  If a user sets a specific type and you want to require a field based on that type, you can set a notification to the newly required field to alert the user.

Xrm.Page.getControl("new_name").setNotification("Field specific notification")

image

To get rid of the field notification:

Xrm.Page.getControl(“new_name”).clearNotification()

Check back soon for more posts about new features in CRM 2013!