Showing posts with label microsoft dynamics crm. Show all posts
Showing posts with label microsoft dynamics crm. Show all posts

Monday, June 15, 2009

MSCRM: upgrade 32-bit MSCRM 3.0 to 64-bit MSCRM 4.0

Below are our notes from recently upgrading a clients 32-bit Small Business Server 2003 (SBS2003) with SQL Server 2000 to 64-bit Windows Server 2008 with SQL Server 2008. We hope that you find them useful.




As you may probably be aware - in the above situation, it is not possible to upgrade directly. MSCRM 3.0 is not supported on 64-bit Windows Server 2008 and MSCRM 4.0 is not supported on SQL Server 2000. So a transitional interim server is required. We set up a Virtual Machine with Windows Server 2003 and SQL Server 2005 to act as the transitional server. Both MSCRM 3.0 and 4.0 are supported in a Windows Server 2003 and SQL Server 2005 environment.




Before starting, you'll need to make sure that all prerequisites have been installed on the interim Windows Server 2003 and the new Windows Server 2008 machines. For details of the prerequisites, refer to the Microsoft CRM 3.0 Implementation Guide and Microsoft CRM 4.0 IG Planning document.


Also, please note that if the interim server has had MSCRM 4.0 installed on it previously (perhaps it was used for testing purposes?) then we recommend that you manually remove the Microsoft Dynamic CRM 4.0 server before starting. Just using Add/Remove programs does not remove all files and/or registry entries which can cause anomalous errors when upgrading.



In summary, these are the steps which we went through:


* Install the Microsoft CRM 3.0 Redeployment Wizard on the transitional server

* Redeploy the Microsoft CRM 3.0 installation from the SBSSVR 2003 box to the Windows Server 2003 - see Microsoft CRM 3.0 Redeployment guide

>> See this article if get the error "you cannot mix small business edition and professional edition license keys"

>> See this article if you get a warning "the specified database has a later version"


* Thoroughly test the new MSCRM 3.0 installation!


* Install MSCRM 4.0 as according to the Microsoft Dynamics CRM IG Installing document section 2-16

>> For more details on warnings and errors that you might get during the installation wizards final checks, then review the installation log here: C:\Documents and Settings\(user)\Application Data\Microsoft\Mscrm\Logs\Crm40svrsetup.log

>> See the article here is you get warning messages about "word breaker for language 9999 is not installed"

>> See the article here if you get an error that "The full-text indexes on the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM 3.0 full-text indexes"

>> See the here article if you have been using the unsupported currentUserHasRole to control field access.




* Thoroughly test the interim MSCRM 4.0 installation!

>> See the article here if "custom ISV Config menu options do not show".

* Redeploy MSCRM 4.0 to the 64-bit Windows Server 2008 / SQL Server 2008 environment as according to the Microsoft "How to move the Microsoft Dynamics CRM 4.0 deployment" Knowledgebase article.

>> See the article here if, when installing MSCRM 4.0, you get the error "the instance name must be the same as the computer name" from the Microsoft SQL Server System Requirements check.
>> Note that the final step to change the Organization in the Deployment Manager does take a while to execute at the stage where you can "Auto-map users" (or at least it did for us!). To speed up the process, then assuming that the old and new servers are on the same domain, then you can just "Keep existing" which is significantly quicker.


* Thoroughly test the final MSCRM 4.0 installation!

>> See the article here if "custom ISV Config menu options do not show".



We hope that this article has helped! Please comment to add any further tips and links that might be useful to people upgrading to MSCRM 4.0.



For more Microsoft Dynamics CRM resources and more including applications such as QuoteWerks, ACT! by Sage, plus software and website development tips, then please see the Hilltops IT website.

Saturday, June 13, 2009

MSCRM: CRM 4.0 install starts then crashes, Managed Setup exited with code -532459699

When running the ServerSetup.exe a screen appears initially, but then the installation crashes fata error.

In the C:\Documents and Settings\(user)\Application Data\Microsoft\Mscrm\Logs\Crm40svrsetup.log installation log file is the message:
"Managed Setup exited with code -532459699"

In the C:\Documents and Settings\(user)\Application Data\Microsoft\Mscrm\Logs\crm40setup.log installation log file is the message:
"Microsoft Dynamics CRM is already installed."


Complete log file entries look like this:

crm40svrsetup.log

18:02:39 Info === Setup bootstrap logging started 13/06/2009 18:02:39 ===
18:02:39 Info Bootstrap version: 4.0.7333.3.
18:02:39 Info User: administrator.
18:02:39 Info === Setup bootstrap logging ended 13/06/2009 18:02:39 ===
18:02:40 Info === Setup bootstrap logging started 13/06/2009 18:02:40 ===
18:02:40 Info Bootstrap version: 4.0.7333.3.
18:02:40 Info User: administrator.
18:02:41 Info .NET version found is 3.0.30618.0
18:02:41 Info IsDotNetInstalled=1
18:02:41 Info IsDrWatsonInstalled=1
18:02:41 Info MSXML found is 6.20.1099
18:02:41 Info IsMsXmlInstalled=1
18:02:41 Info Installer path for Microsoft Visual C++ Runtime set to D:\Redist\amd64\VcRedist\vcredist_x64.exe
18:02:41 Info IsReportViewerControlInstalled=1
18:02:41 Info Sql Native Client version found is 9.0.3042
18:02:41 Info IsSqlNativeClientInstalled=1
18:02:41 Info Installing Microsoft Visual C++ Runtime
18:02:43 Info Installation of Microsoft Visual C++ Runtime has completed. Exit code: 0. Result: Version installed: 8.0
18:02:43 Info === Setup bootstrap logging ended 13/06/2009 18:02:43 ===
18:02:46 Info === Setup bootstrap logging started 13/06/2009 18:02:46 ===
18:02:46 Info Bootstrap version: 4.0.7333.3.
18:02:46 Info User: administrator.
18:02:46 Info Managed Setup exited with code -532459699.
18:02:46 Info === Setup bootstrap logging ended 13/06/2009 18:02:46 ===




crm40setup.log

18:02:38 Info === Setup bootstrap logging started 13/06/2009 18:02:38 ===
18:02:38 Info Bootstrap version: 4.0.7333.3.
18:02:38 Info User: administrator.
18:02:38 Info Invoked with command line: setupserver /InstallAlways
18:02:39 Info Running D:\Server\amd64\SetupServer.exe
18:02:39 Info Loading bootstrap library D:\Server\amd64\ServerSetup.dll
18:02:39 Info Microsoft Dynamics CRM is already installed.
18:02:39 Info Closing bootstrap library D:\Server\amd64\ServerSetup.dll
18:02:39 Info Copying installer files to local directory:
18:02:39 Info Package: D:\Server\amd64\Server.msi, Options: REINSTALL="Installer" REINSTALLMODE=vo INSTALLDIR="C:\Users\ADMINI~1.DYN\AppData\Local\Temp\2\MSCRM_{03A7A017-659A-4914-8400-3EC097D33A22}" TARGETDIR="C:\Users\ADMINI~1.DYN\AppData\Local\Temp\2\MSCRM_{03A7A017-659A-4914-8400-3EC097D33A22}" ALLOWRUN=1
18:02:40 Info Loading bootstrap library C:\Users\ADMINI~1.DYN\AppData\Local\Temp\2\MSCRM_{03A7A017-659A-4914-8400-3EC097D33A22}\ServerSetup.dll
18:02:46 Info Closing bootstrap library C:\Users\ADMINI~1.DYN\AppData\Local\Temp\2\MSCRM_{03A7A017-659A-4914-8400-3EC097D33A22}\ServerSetup.dll
18:02:46 Info === Setup bootstrap logging ended 13/06/2009 18:02:46 ===




Even though Microsoft Dynamics CRM 4.0 may not appear on the Add/Remove Programs list, some files or registry entries may have been completely removed. We recommend that you go the setps in the How to anually remove the Microsoft Dynamic CRM 4.0 Microsoft Knowledgebase article to ensure that a previous installation has been completely removed.

MSCRM: Installing - the instance name must be the same as the computer name

When installing Microsoft Dynamics CRM MSCRM 4.0 you get the error "the instance name must be the same as the computer name" from the installation wizard Microsoft SQL Server System Requirements check.




This may be because 1) the server name has been changed since SQL Server was installed, or 2) you are running a 64-bit or Windows Server 2008 environment.

Note that in the Microsoft Dynamics CRM 4.0 "Help", it may state that only SQL Server 2005 is supported. This is not the case; for more information please see the Microsoft Knowledgebase article "Support for running Microsoft Dynamics CRM 4.0 together with Microsoft SQL Server 2008".

To check if the server name has been changed since SQL Server was installed, open Microsoft SQL Server Management Studio and run the following query:
SELECT * FROM sys.servers

If the current server name is not listed, then use the following procedures to correct the issue:
Execute sp_dropserver <OldServerName>
Execute sp_addserver <NewServerName>, local

If you are running a 64-bit or Windows Server 2008 environment, then check that Named Pipes have been enabled in the SQL Server Network Configuration (Start menu All Programs Microsoft SQL Server Configuration Tools SQL Server Configuration Manager expand SQL Server Network Configuration highlight Protocols for <SQLInstanceName> Enable Named Pipes.

MSCRM: the specified database has a later version

Upgrading or redeploying your Microsoft Dynamics CRM (MSCRM) 3.0 installation, you get the error: "the specified database has a later version" in the final checks of the installation wizard.

This is a warning only, so the wizard will allow you to continue. To remove the error though, you can update the Build Number field in the MSCRM Build Version table:

UPDATE BuildVersion SET Revision = 0 WHERE BuildNumber = 5300

MSCRM: you cannot mix small business edition and professional edition license keys

Upgrading or redeploying your Microsoft Dynamics CRM (MSCRM) 3.0 installation, you get the error: "you cannot mix small business edition and professional edition license keys" in the final checks of the installation wizard.

Try deleting all the rows from the MSCRM License table:

DELETE FROM MY_Organisation_MSCRM.dbo.License

Thursday, June 11, 2009

MSCRM: testing a User's Role (CRM 4.0 only)

Code required to test whether the logged in user to Microsoft CRM has a particular role:

function currentUserHasRole(roleName)
{
//get Current User Roles
var oXml = GetCurrentUserRoles();

if(oXml != null)
{
//get list of role names
var roles = oXml.selectNodes("//BusinessEntity/q1:name");

if(roles != null)
{
for( i = 0; i < roles.length; i++)
{
if(roles[i].text == roleName)
{
//return true if user has this role
return true;
}
}
}

}
//not found, return false
return false;

}

function GetCurrentUserRoles()
{
var xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
GenerateAuthenticationHeader() +
" <soap:Body>" +
" <RetrieveMultiple xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +
" <query xmlns:q1=\"http://schemas.microsoft.com/crm/2006/Query\" xsi:type=\"q1:QueryExpression\">" +
" <q1:EntityName>role</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>name</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1:Distinct>false</q1:Distinct>" +
" <q1:LinkEntities>" +
" <q1:LinkEntity>" +
" <q1:LinkFromAttributeName>roleid</q1:LinkFromAttributeName>" +
" <q1:LinkFromEntityName>role</q1:LinkFromEntityName>" +
" <q1:LinkToEntityName>systemuserroles</q1:LinkToEntityName>" +
" <q1:LinkToAttributeName>roleid</q1:LinkToAttributeName>" +
" <q1:JoinOperator>Inner</q1:JoinOperator>" +
" <q1:LinkEntities>" +
" <q1:LinkEntity>" +
" <q1:LinkFromAttributeName>systemuserid</q1:LinkFromAttributeName>" +
" <q1:LinkFromEntityName>systemuserroles</q1:LinkFromEntityName>" +
" <q1:LinkToEntityName>systemuser</q1:LinkToEntityName>" +
" <q1:LinkToAttributeName>systemuserid</q1:LinkToAttributeName>" +
" <q1:JoinOperator>Inner</q1:JoinOperator>" +
" <q1:LinkCriteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>systemuserid</q1:AttributeName>" +
" <q1:Operator>EqualUserId</q1:Operator>" +
" </q1:Condition>" +
" </q1:Conditions>" +
" </q1:LinkCriteria>" +
" </q1:LinkEntity>" +
" </q1:LinkEntities>" +
" </q1:LinkEntity>" +
" </q1:LinkEntities>" +
" </query>" +
" </RetrieveMultiple>" +
" </soap:Body>" +
"</soap:Envelope>";

var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xmlHttpRequest.setRequestHeader("SOAPAction"," http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
xmlHttpRequest.send(xml);

var resultXml = xmlHttpRequest.responseXML;
return(resultXml);

}




The code need to be placed at the top of any Form Event where you want to use the function. the function can then simply be called as follows:

if(currentUserHasRole(‘Salesperson')){
//do this stuff
}else{
//do other stuff
}




We hope this helps anyone getting to grips with java script coding in MSCRM 4.0!

Please post any thoughts or improvements that you have to this.

Thanks, Hilltops IT

MSCRM: testing a User's Role (CRM 3.0 only)

This is quite an old tip now, on several blogs and forums, but we'd thought we'd repeat it here to keep it with the updated code for MSCRM 4.0 (see next post). The code below needs to be put in either the global.js file (by default located here C:\Program Files\Microsoft CRM\CRMWeb\_common\scripts\) of in the top of each Form event where you need to call the function. It's then just a case of calling the following in the Form Event:

if(currentUserHasRole(‘System Administrator’)){
//do this stuff
}else{
//do other stuff
}


Note that putting the code in the global.js is a risky strategy as if a patch or update is installed, then the changes may be lost. It does save copy/pasting into each and every Event; the choice is yours!

Java script code to test whether a User has a particular Role:

function getUserId()
{
try
{
var command = new RemoteCommand("SystemUser", "WhoAmI", "/MSCRMServices/");
var oResult = command.Execute();

if (oResult.Success)
{
return oResult.ReturnValue.UserId;
}
}
catch(e)
{
alert("Error while retrieving userid.");
}
return null;
}

function getUserRoles(userId)
{
try
{
var command = new RemoteCommand("UserManager", "GetUserRoles");
command.SetParameter("userIds", "<guid>" + userId + "</guid>");

var oResult = command.Execute();

if (oResult.Success)
{
return oResult.ReturnValue;
}
}
catch(e)
{
alert("Error while retrieving roles.");
}
return null;
}

function userHasRole(userId, roleName)
{
result = getUserRoles(userId);
if (result != null)
{
var oXml = new ActiveXObject("Microsoft.XMLDOM");
oXml.resolveExternals = false;
oXml.async = false;
oXml.loadXML(result);

roleNode = oXml.selectSingleNode("/roles/role[name='" + roleName + "']");
if (roleNode != null)
{
if (roleNode.selectSingleNode("roleid[@checked='true']") != null)
return true;
}
}
return false;
}

function currentUserHasRole(roleName)
{
userId = getUserId();
return userHasRole(userId, roleName);
}

Monday, June 8, 2009

CONNECTIT: now available for purchase through BT TradeSpace

The ConnectIT range of products are now available for purchase through BT TradeSpace.

For more information on the ConnectIT suite and how they can help your business save hours of repetitive manual work, please see the ConnectIT websites here:

Or contact your ConnectIT / QuoteWerks reseller.

Sunday, June 7, 2009

MSCRM: custom ISV Config menu options do not show

Custom ISV Config menu options do not appear in Microsoft Dynamics CRM MSCRM 4.0.

This may be following a new installation or following an upgrade from Microsoft Dynamics CRM MSCRM 3.0.

First check that the ISVIntegration key has been added to the <appsettings> group in the web.config file. the web.config file can be found in the Microsoft CRM www root folder. The details should read as follows:

<!--
ISV Integration
========================================================================================
Using /_resources/isv.config.xml, it is possible to customize certain Menus and Tool Bars
throughout the application. This setting is provided as a performance optimization, when
there are no customizations to be rendered this setting should be "Off".
Recommended Setting: "None" (Unless you have customized the isv.config.xml file)
Values:
"All" - ISV Integration is turned on for both Outlook and web client
"Outlook" - ISV Integration is turned on for just Outlook client
"OutlookLaptopClient" - Turned on just for the Outlook laptop client
"OutlookWorkstationClient" - Turned on just for the Outlook work station client
"Web" - ISV Integration is turned on for just the web client
"None" - Not turned on.
Multiple values can be used as long as they are separated by a comma and do not contain spaces. e.g: "Web,OutlookLight"
-->

<add value="Web" key="ISVIntegration">


Next make sure that the ISV Extensions option is selected for the appropriate User roles: see MSCRM 4.0 Settings Administration Security Roles open the appropriate Role Customization tab Miscellaneous Privileges group ISV Extensions option should be coloured green.

Finally make sure that the appropriate Clients have been selected in the System Settings Custom menus and toolbars option: see MSCRM 4.0 Settings Administration System Settings Customization tab Custom menus and toolbars option.


For more information on our Microsoft Dynamics CRM and software development services, please contact us on +44(0) 1782 564252 or email development@hilltopsit.co.uk

Saturday, June 6, 2009

MSCRM: full-text indexes on the Microsoft Dynamics CRM database are not consistent

Problem upgrading from Microsoft Dynamics CRM 3.0 to 4.0: when Microsoft Dynamics the setup wizard System Requirements runs the checks, the error "The full-text indexes on the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM 3.0 full-text indexes" appears. This is a fatal error which does not allow you to continue with the installation.

Checking in the setup log file here provided the following additional information.

C:\Documents and Settings\(user)\Application Data\Microsoft\Mscrm\Logs\Crm40svrsetup.log

06:12:42 Info The following full-text indexes are not consistent with Microsoft Dynamics CRM 3.0 full-text indexes:
06:12:42 Info tableowner: dbo
06:12:42 Info tablename: productbase
06:12:42 Info fulltextkeyindexname: cndx_primarykey_product
06:12:42 Error remark: modified full-text index
06:12:42 Error
06:12:42 Error The full-text indexes on the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM 3.0 full-text indexes.
06:12:42 Error Check SqlFullTextIndexValidator : Failure: The full-text indexes on the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM 3.0 full-text indexes.




WARNING
Several blog and forum postings will take you to this article: http://support.microsoft.com/kb/927226

Do not be tempted to remove the index!!! The error is stating that the full-text index has been modified, not added. Removing the index would not only remove the index and relationships from the Product table, but also makes changes to several other tables. Trying to run the installation check generates even more errors!!!


The cause of the error was found to be because a full-text catalog had been added to the ProductBase table. Removing the full-text catalog resolved the problem and re-running the setup wizard System Requirements checks run ok allowing you to continue with the upgrade.

For more information on our Microsoft Dynamics CRM and software development services, please contact us on +44(0) 1782 564252 or email development@hilltopsit.co.uk