Posted on 24. May 2015

Turbo Forms: Get your JavaScript ready for CRM2015 Update 1

With the introduction of 'Turbo Forms' in CRM2015 Update 1 I thought I'd give you a heads up on what you'll need to address in your JavaScript to support this new form rendering engine. The Dynamics CRM Team Blog has a very good article on the changes but there have been some misunderstandings of the statement 'we have parallelized as many operations as possible'. In actual fact the script loading of custom web resource scripts has not really changed since CRM2013 - It remains the same as I describe in my CRM2013 Script Loading Deep Dive. The operations that are parallelized with turbo form rendering are the internal form load operations rather than custom ones. Custom JavaScript loading has always been parallelized since CRM2013.

Turbo Form Page Differences

Before Turbo Forms both global scripts and your custom web resources would have been loaded into a content IFRAME within the main window each time you navigate between records.

The biggest change with Turbo Forms is that the content IFRAME is kept in memory and re-used for performance reasons. This parent content IFRAME is even kept in memory between navigation between different entity types. Any custom JavaScript is then loaded into a child IFRAME (via the ClientApiWrapper.aspx page) so that when you navigate between records they are re-loaded.

SparkleXRM solutions already have a load order mechanism that ensure that your custom scripts are loaded in order that they are needed.

Impact on unsupported code

If your JavaScript is using only supported SDK calls then there will be no impact from this new loading mechanism. Sometimes it is necessary to use unsupported functions or referencing parameters of the Content IFRAME (such as the query string). Since your custom JavaScript is now running in the context of the ClientApiWrapper (rather than the content IFRAME) any reference to window methods such as window.openStdWin or window.location.href will fail. In order to access these objects you will need to reference parent.window.

The ribbon workbench 'how-to' article that shows starting a dialog from a ribbon button does infact use openStdWin to ensure consistency with the out of the box dialog experience. I have updated the code to use the parent window when required.


There are a couple of other notable aspects of Turbo Forms that I thought I'd point out:

IFRAMES that are collapsed by default are not sized correctly.

If you have an IFRAME or HTML Webresource inside a Tab that is collaposed by default you will find that they are not sized correctly when the tab is expanded. This will be fixed in an upcoming update but until then you will need to show the tab by default and collapse when the form is loaded.

entityType vs typename

Turbo Forms have dropped the typename attribute of Lookup values.

In the past, the following code would return the same:


With Turbo Forms only the documented entityType is available. The typename attribute was left over from the CRM4 days and just had not been removed until now!



Posted on 1. January 2015

Ribbon Workbench 2015 (Happy New Year!)

Happy New Year – I hope 2015 will bring you lots of good things. Dynamics CRM 2015 upgrades are rolling out to Dynamics CRM online organisations with rapidly increasing frequency and so I have updated the Ribbon Workbench for 2015 support. You will see a new update notification when you next open the Ribbon Workbench and you can let the auto update do the download and install for you. If you would rather install manually you can download and install over the top of the previous version.

Automatic update is mandatory after 10th January – why?

You'll have the option to update before the 10th of January and then you'll be forced to update after that. Some people have asked me other the last couple of years why I roll out these mandatory updates. Initially this was about ensuring that the beta version was updated with any bug fixes but since then it has been a way of ensuring that I keep rolling out new version. I set a 6 month release cycle target so that even though I roll out minor updates I have to roll out at least one mandatory update every 6 months! I hope you don't mind being forced to update too much – I certainly feel that the benefits outweigh the downsides and it keeps me on my toes J

Command bar 2015

The good news about the 2015 command bar is that after the big shift from the ribbon in CRM2013 there haven't been any significant changes. All of your ribbon xml customisations in CRM2013 will remain to work in CRM2015 provided that any JavaScript you are calling in your commands doesn't use any deprecated SDK elements. If you compare the RibbonXml XSD between the CRM2013 and CRM2015 SDKs you'll see that they are in fact identical!

All the best for 2015!


Posted on 4. August 2014

SharePoint Integration Reloaded – Part 1

Back in the day when CRM2011 was first in beta I blogged about the exciting SharePoint integration and how it works. This post is about the exciting new server side SharePoint integration that is now available as part of CRM2013 SP1 Online.

There has already been some good posts on how to set up SharePoint sever-side Sync but in this series I'm going to explain how the server to server integration works in more detail and run through some scenarios of how it can be used for custom solutions.

CRM List Component Integration

Before CRM2013 SP1 was released the only option for SharePoint Integration was to use the CRM List Component. Each document location was surfaced on a record form record via an IFRAME that placed a SharePoint page inside the CRM page via the list component aspx page. This SharePoint page rendering the document library's default view with a CRM theme and provided the upload/download commands.

  1. The CRM form page is displayed in the browser and including an IFRAME that requested the configured document library page from SharePoint.
  2. The IFRAME shows the SharePoint document library styled to look like CRM. This required the user to be independently authenticated with SharePoint.
  3. Using any of the actions in the page (New/Upload etc.) sends requests directly to SharePoint.

Changing Landscape

This approach worked well but since the user was accessing SharePoint directly within the IFRAME they'd sometimes encounter authentication issues where they must be authenticated with SharePoint first and sometimes SharePoint needed to be configured to allow inclusion of content in IFRAMES. In addition to this the list component required a sandbox host to run but this feature is being phased out in SharePoint Online.

Server to Server SharePoint Integration (S2S)

With the introduction of CRM2013 SP1 a new type of integration has been developed that provides direct server to server integration between SharePoint and CRM thus removing the need for the user to be pre-authenticated with SharePoint on the client.

  1. The Record page includes a standard sub grid that is populated using the CRM entity query object model. CRM converts a RetrieveMultiple request on the SharePoint Document entity into SharePoint CAML (Collaborative Application Markup Language) query and sends it to the SharePoint Web Services. The important part here is that this query is run in the context of the currently logged on user and so they only see the document that they have access to in SharePoint (more on how this works in part 2 of this series).
  2. Documents are rendered inside the CRM Form HTML as a standard sub grid in the same way that any other record might be displayed.
  3. Using the New/Upload command bar buttons sends a request to CRM by way of an Execute Request in the same way that any other command bar buttons might do.
  4. CRM uses the SharePoint Web Service API to execute the requests and refreshes the sub grid.

This server to server integration only works for CRM Online/SharePoint Online combinations that are in the same tenant due to the nature of the server to server authentication and can be turned on in the Document Management Settings using the 'Enable server-based SharePoint integration'. There is a note that states that sandboxed solutions will not be supported in the future for SharePoint online.

Differences between List Component and Server-to-Server

Once S2S integration is enabled you'll see a similar view to the list component but it looks far more CRM2013 like. Apart from a slicker interface there are a few other differences:

Folder Support

The S2S sub grid doesn't support folders within the document library and so all documents are flattened down underneath the document location folder. The Location column does give you folder name which you can sort by to allow grouping by folder.

Custom Views

The great thing about having the documents queried by CRM is that you can create custom views of documents in the same way you would with any other entity in CRM. When using the list component the default view in SharePoint was rendered in the IFRAME meaning that to get new columns you had to have list customisation privileges on SharePoint such that all users would see the changes. With the new server to server integration you can select SharePoint columns to include in your own views and even add in your own filters using the CRM advance find interface. If you think about it – this is very cool!

Item Actions

The List Component was by nature very similar to the SharePoint list user interface and so it had more or less full support of actions that can be performed from SharePoint (with the exception of workflow operations). The server to server sub-grid provides all the main functions but with some options such as Alert Me, Send Short Cut, View History and Download a Copy being unavailable.

The S2S integration gives the following command bar actions:

This is in comparison to the List Component actions that are as shown below.

Inline Dialogs

With CRM2013's single page user experience any pop-out windows are supposed to be kept to a minimum. When using the list component operations (such as check-in/out) a new window would always pop out but with S2S integration an inline dialog shown instead. This really make it feel tightly integrated and slick.

Out of these differences, the lack of folder support is the only one that has had any significant effect on my solutions but actually can be seen as an advantage if using sub-folders to hold child entity documents. In this scenario all documents will be visible from the parent record's document view rather than rely on the user drilling down into each folder to see content.

That's all for now but in the next article in this series I'll show you more of how this functionality works under the covers.

Read Part 2


Posted on 2. February 2012

CRM 2011 Update Roll Up 6 (UR6) "Existing SQL Server connections to the Microsoft Dynamics CRM databases must be closed before setup can continue."

I've installed UR6 on a couple of server farms so far with not issues but today I encountered a problem that I'd not seen before.

The server UR6 install worked fine, but the Organisation still showed version 5.0.9688.1533 which is UR5 rather than the expected 5.0.9690.1992. Using File->About Microsoft Dynamics CRM, the version showed as (5.0.9690.1992) (DB 5.0.9688.1533)

Updating should have been simply a case of using Deployment Manager and selecting 'Update' on the Organisation but it gave the following error:

Existing SQL Server connections to the Microsoft Dynamics CRM databases
 must be closed before setup can continue.

I tried the following with no success:

1. Restarted SQL Server

2. Rebooted SQL Server

3. iisreset on the Application Server

The fix was to stop the Async services and sandbox service. Then the database update went through with no problems.


UPDATE: The server needed an iisreset before the About dialog reflected the new database version.


Posted on 2. November 2010

You have already imported and upgraded this organization

Since importing CRM 4 customisations xml is not possible with Dynamics CRM 2011 Beta 1, using the import organisation wizard is the only option. During development, I’ve found that there is no way of importing and upgrading a CRM 4.0 organisation more multiple times. Once you import and upgrade a CRM 4 organisation, the OrganisationId is retained in the database (rather than a new one being assigned as for when you import a CRM 2011 organisation database), so importing and upgrading the same organisation results in the error "You have already imported and upgraded this organization". Even if you delete the previous import, the import still fails.

To get around this I used the following steps:

Warning: I'm doing this a development environment, and this is something that you would never do in production. Also, always make a backup first.

1. Disable and Delete the previously imported organisation using Deployment Manager

2. Run the following script against the MSCRM_Config database. Replace 'YourOrgName' with the name of the organisation you used when importing the first time.

-- Remove a previously imported and upgrade organisation
DECLARE @orgName nvarchar(255) ='YourOrgName' 
DECLARE @organisationid uniqueidentifier
SELECT @organisationid=ID from Organization WHERE UniqueName=@orgName
DELETE FROM SystemUserOrganizations where OrganizationId=@organisationid
DELETE FROM OrganizationProperties where ID=@organisationid
DELETE FROM OrganizationFeatureMap where OrganizationId=@organisationid
DELETE FROM OrganizationMaintenanceJobs where OrganizationId=@organisationid
DELETE FROM Organization where ID=@organisationid


 3. Re-import the organisation using Deployment Manager