Changing the name of the SQL Server that CRM uses

When spinning up bundled images on Amazon’s EC2 service, you have the option to maintaining the base image’s name or letting the config service update it for you. We chose to update it, and of course, the CRM Asynchronous Service would fail to start. Fortunately, it’s not too difficult to make the necessary changes to get it up and running again. (In our case, CRM and SQL were on the same server)

The following keys in the registry need to be updated in the MSCRM folder:

  • configdb
  • database
  • metabase
  • serverurl
  • The following tables in the ConfigDB need to be updated with the new Server name:

  • Organization
  • Deployment
  • After that the service should start up without any problems. In a bundled environment where you will be changing the server name often and you have one server for CRM and SQL, you can simply update your base image so that all connection strings in the registry and database have ‘localhost’ as the datasource instead of the servername. However, the Name column in the Deployment table will need to be updated with the new name of the Server.

    Modifying Views outside Microsoft CRM

    Last week a colleague tried to create a view in Microsoft CRM to show Accounts that were in an Inactive state and had a merged Master contact record. Microsoft CRM doesn’t allow the MasterID field to be queried or returned in Advanced Find nor does it allow it to be changed (by changing the ‘Searchable’ option on the attribute).

    The quickest and dirtiest way around it is to modify the view in the table itself. Since all user and system views are simply FetchXml, we’re able to create views that the AF tool won’t let us create.

    I used his view as the starting point:
    1

    I Searched and found the query in the UserQueryBase table and copied out the FetchXml and LayoutXml columns.

    I modified the FetchXml as follows (the additions in bold and italics):
    2

    And I modified the LayoutXml as follows (the additions in bold and italics):
    3

    I then saved them back to the SQL table and re-ran the query in CRM:
    4

    Needless to say, this is an unsupported customisation change to Microsoft CRM- after doing the above, you’ll see the following in Advanced Find:
    5

    HTH.