Upgrade from CRM 2011 to 2013 fails with “Subquery returned more than 1 value. Not Permitted CRM 4.0″


We recently stumbled upon an issue when upgrading a customer from CRM 4.0 to CRM 2013. As is required, you must first upgrade the 4.0 database to 2011 and then from 2011 to 2013. The 4.0 to 2011 upgrade succeeded without error but threw an error when going from 2011 to 2013. 2013 was on update rollup 2. The error thrown was:

Error| Installer Complete: OrganizationUpgrader – Error encountered
14:56:47| Error| Exception occured during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: Error.ActionFailed Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction
InnerException: System.Data.SqlClient.SqlException (0x80131904): Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

The statement has been terminated.

We upgraded the database from 4.0 to 2011 one afternoon and then tried going from 2011 to 2013 the following morning. As it turns out, CRM 2013 contains a query that checks to see if an organization is a new organization or an upgrade by checking the CreatedOn field of the system solution. It does this by seeing if the CreatedOn date/time is within one day (24 hours) of the current time. If the CreatedOn date of the System Solution is within 24 hours, it is considered a new organization. Here is the query:

IF EXISTS (SELECT * FROM SolutionBase WHERE SolutionId=’FD140AAD-4DF4-11DD-BD17-0019B9312238′
AND CreatedOn >= DATEADD(day, -1, GETUTCDATE()))
BEGIN

(This query goes on to Update prvAppendToOpportunity depth to global on sales person role and update prvAppendToQuote, prvAppendToOrder, prvAppendToInvoice to local on sales person role.)

When the 4.0 database is upgraded to 2011, it sets the CreatedOn date/time to whatever the UTC date/time is of that upgrade. So when going from 2011 to 2013 it sees the new date/time resulting from the upgrade to 2011 and considers it a new organization and errors out on the above query. Below is the query that can be run to check the CreatedOn date of your 2011 database.

crmquery

The easy solution to this is to just wait 24 hours between the upgrade stages but if you are in a time crunch or minimizing down time for a go-live, you can update the CreatedOn date/time of the system solution directly in the 2011 database. Remember that the time is in UTC, changing the date back one day should be easier than trying to figure out the time difference in your time zone. However, keep in mind that updating fields directly through SQL is not a change supported by Microsoft so this is done at your own risk! Not sure if this issue is isolated to just Update Rollup 2 or if this occurs with 2013 RTM, Update Rollup 1, or Service Pack 1 yet.

Thanks to my young CRM Jedi Gage Pennisi for putting the details together!


Need to build a CRM 3 VM to Upgrade to CRM 2013? Here’s how.


We have a few customers still running CRM 3.0 after all these years. With the excitement of CRM 2013, they have decided to upgrade at one shot. Dynamics CRM 3.0 can upgrade to CRM 4.0, or one version at a time. The users don’t have be aware of this step, only the end game which is CRM 2013.

In order to process this change, and migrate the customer to the cloud, we need to upgrade their systems. In order to do this, I decided to build a VM in order to upgrade CRM 3.0 to 4.0, and then will use my 2011 VM to upgrade to 2011, then insert DB into the new CRM 2013 development system.

Easier said than done Right? I really had to dig into my memory banks to remember the process, and thought it would be helpful to others to have it accessible. So Here we go:

1. Build a Windows Server 2003 R2 Standard build VM
2. Make sure you add enough disc space to cover the size of your production database, zipped and unzipped together. I’m using 60 gigs, 2 processors and 2.5 gigs of memory in the VM.
3. Add the Domain Controller and Application Server Roles (select ASP.NET as well).
4. Reboot
5. Install SQL Server 2005 with reporting services. You must configure reporting services as well.
** CRM 3.0 started on SQL2000, and was commonly upgraded to SQL2005. The CRM 3.0 installation download includes the fixes to work with SQL2005. In the past we had to install it on SQL 2000, upgrade SQL2005 after.
6. Test Access to Reporting services once completed.
7. Copy the production CRM 3.0 database and unzip on this VM.
** Make sure you copy both ORGNAME_MSCRM and ORGNAME_METABASE as these were separate DBS in CRM 3.0
8. Restore CRM 3.0 database to the SQL Server.
9. On the CRM 3.0 CD, explore and run the redeployment tool .MSI.
10. Run the CRM 3.0 redeployment tool, enter server name localhost and select the production DBs.
11. Choose to manually map, and find a user account of administrator, mapping your VM admin id.
12. Let redeployment complete.
13. Launch the CRM 3.0 installation, and proceed with setup. When you enter the SQL Server (localhost) you will be able to connect to an existing deployment. Choose your databases here.

That will get CRM 3.0 running again in your VM. Please note that all ISV’s etc should be removed as they will no longer work. You could have manually cleanup unless you run the uninstallers of these applications in production.

You might also want to consider using a P to V technology (Physical to Virtual) to build the VM exactly as it is in production but Virtual.

Enjoy!


CRM 2013: Windows 8 Mobile Client – How to Pin/Create CRM Tiles to Start Menu


The Microsoft Product Team has done a great job delivering the Microsoft Dynamics CRM 2013 mobility clients for Windows 8 and IPADs. I noticed a screen shot on the web, where tile related to CRM we posted on the Windows 8 Start Menu for quick access.Screenshot (1)

I was trying to figure this out, and it’s rather simple. Once inside the Microsoft Dynamics CRM 2013 Mobility Client, the first page is the Mobile Dashboard. On that dashboard, you can select the view of activities, account, contacts etc by pressing on the name with your finger or your mouse and drag them down like you would an tile on the Windows 8 start menu.Screenshot (3)

This will bring up the bottom navigation bar. You can then choose to pin to start menu! As you can see this quick tip will let you immediately access your leads and opportunities right from the start! Enjoy.


CRM 2013: Ipad Mobile Client for CRM 2013 – Screen Shot Tour!


Without further adieu, Microsoft Dynamics CRM 2013 IPAD Mobile Screen Shots. We did not get access to this application during the Beta’s as you needed a special license to run it on the devices. I successfully downloaded and install the client from the Appstore today by searching for Dynamics CRM.

Searching the AppStore
appstore

Start Page- Enter your CRM URL (IFD – Internet Facing Deployment Required for OnPremise, CRM Online is ready to go.)
IMG_0379

How to Page on how to navigate around
IMG_0381

Sales Mobile Dashboard – Home button will take you here.
IMG_0382

Navigation Menu – Click the menu icon next to the home button
IMG_0383

Opportunity Record
IMG_0384

Account Record
IMG_0385

Quick Search – Searches up to 10 entities (uses the quick view view of each entity selected
IMG_0386

A very nice rollout! Thanks to the Microsoft Product Team for a great job on this fantastic release!


CRM 2013: How to enable Bing Maps API integration


Microsoft Dynamics CRM 2013 now comes with an out of the box integration with Bing Maps. This integration uses the address record of your account, contact or system entity to disable that location and render a Bing Map right on the CRM 2013 page.CRM2013accountformwithbing

In order to set this up, you will first need to get a Bing Maps API Key from here:
http://www.microsoft.com/maps/create-a-bing-maps-key.aspx.

You will notice there are several pricing options including a free trial for 90 days. Please decide which one fits your organization best. Now Let’s go Back to CRM to configure it:

Open the Settings, Administration, System Settings. Under the General Tab:bingmapsystemsettings

Select Yes, Show Bing Maps on Forms, and then Insert the Bing Maps API Key in the yellow area. Press save. Now when you open your account, contact or custom entity with Bing Map inserted on the form, you will see the map as shown above!

You can insert the Bing map onto a form by clicking the button for Bing maps on the form customization screen under the insert tab. Please ensure you have address information available on the chosen entity for  your Bing integration. Enjoy!crm2013insertbingmap

Here’s how to do this on a custom entity by my fellow MVP Andrii Butenko
http://a33ik.blogspot.com/2013/10/adding-standard-bing-map-control-to.html

Enjoy


CRM 2013: How to disable autosave so my plug-in code won’t be effected


With Microsoft Dynamics CRM 2013, the feature of auto save has been introduced. This feature is really long overdue, and its a feature we often overlook each day. For example, if your typing an email response on your cellphone, and the phone rings, you answer it and go back to work, right? When you returned, your email was right where you left off!

This is the same concept for CRM 2013, and not forcing users to constantly press save and close. As you work on the system the data is periodically saved as indicated by the icon on the button right of the new UI.

savediconcrm2013

saveiconcrm2013

 

 

 

As you can see above, the first ICON of the disc shows everything is saved. As you begin to work the icon changes letting you know you have unsaved changes to the page. If you wait for about 5 seconds the auto save feature will kick in and automatically save those changes for you!

While Microsoft CRM 2013 is certainly thinking ahead of design and form, many CRM 2011 plugins were designed to fire after a user saves a record. This save is captured and the plugin is fired, in this case, over and over again each time auto save kicks in.

Thankfully, Microsoft gave us an option to turn off auto-save for this release to help upgrading customers
whom may not have updated their plugin/sdk code as of yet. Please note, this feature will not be available in future releases, and your new designs should use the SDK Method that works with auto save.

For now, under system settings, you can click the button to disable to the auto save feature and save your upgrade and plugins! This will save you for now, but make sure to look to the future when considering to disable this useful option! Enjoy!

autosave2013

 

 

 

 

 

 

The CRM 2013 SDK also will provide insight into new methods available to watch the state of change.autosaveSDK