CRM news and views from Simon Jackson

Tuesday, March 23, 2010

CRM Sharing Data across Microsoft Dynamics CRM Deployments

Nice white paper on Sharing Data across Microsoft Dynamics CRM Deployments, this is particularly relevant for one of my clients where it is  impractical to meet all their business requirements within a single CRM organisation.

The ability to share data across Users, Teams, and Business Units within a single organization is provided by Microsoft Dynamics CRM 4.0 “out-of-the-box.” Administrators can provide users with differing levels of access to the data stored in CRM based on the roles, privileges, teams and Business Unit settings associated with specific users.
While using a single CRM instance is probably the simplest way to accommodate the data sharing needs within an organization, using multiple instances of Dynamics CRM may be preferable in a number of scenarios.
Consider the following reasons for using multiple instances of Microsoft Dynamics CRM:
  • Organizational Scale, to accommodate large volumes of users or data, or heavy processing
  • Geographical Distribution, to allow users to work against local rather than remote instances of CRM
  • Divisional or partner segregation, to limit the data that is distributed and the levels of access that each instance has
  • Legal requirements, to ensure that data is retained in a specific local geography This paper is focused on sharing data across multiple CRM organizations, which can occur at three distinct levels: Front-End / User Interface Level, Application Level, or Data Level.

This paper is not intended to serve as a solution guide, but rather to assist Microsoft Dynamics CRM architects with designing and implementing solutions to meet the needs of specific business scenarios.

Thursday, March 18, 2010

CRM 4 Import Customisations error "There is insufficient system memory in resource pool 'internal' to run this query."

I ran into the below error when importing customisations on to a new CRM 4 install, which had Server 2008 R2 and SQL 2008 on a virtual server with CRM Rollup 9 applied.

There is insufficient system memory in resource pool 'internal' to run this query

Googling only confused me as I develeved into many SQL fourms.  In the end the solution was really simple.  I'd inadvertantly only allocated 1GB of memory to the machine.  I doubled the memery and the import was sucessfull.

Prior to this issue, I also got the below error during the import:

Could not import a Saved Query {5ADB1DD1-2F93-4C65-AC0A-2372E3EAD103} for ObjectTypeCode 9100 because this is a system Saved Query. The Entity you are trying to import is not the same as the one existing in the database even though it has the same name.

Entity 9100 is the report entity, omitting the entity from the import stopped the issue, but I assume this means that you cannot import the report entity from Rollup 7 customisations export to Rollup 9 CRM instance.

Labels: , ,

Wednesday, March 17, 2010

CRM 4 Import Export Customisations cool tool

I've lost day working out why my CRM customisations have been corrupted because a custom attribute has changed datatype. I've spent hours working out what the exact customisation need to be exported to bring UAT in line with Dev. I've gone cross eyed deleting attributes that are no longer used.  

But no more this tool solves these problems and more, totally awesome, look at at it's features:

  • Console Application, Making it possible to import and export inside nant, msbuild or bat scripts, for example to export the customization each night and “check in” to a source code repository, enabling version control of the customizations. Also to import customizations directly from a MSI installation.
  • Export Only Modifications, You can export a “clean” customization xml in the beginning of a project and save it in the application folder as “CleanCustomization.xml”, the application will compare the current state and only export the entities that are modified or added.
  • Remove Deleted Attributes, This feature only applies when importing a customization. When this operation is selected one will be prompted with all attributes that has been removed in the new customization, given the possibility to remove them from the CRM instance.
  • Changes Attribute data type, When changing an attributes data type and then trying to import it to a CRM instance that still contains the old attribute would normally generate an error. This is now handled and the data inside the old attribute will be converted to the new data type (when possible and logical)
  • Publish, You can publish the customizations, can also be used at it’s own, for example assigning it to a system wide hotkey for fast access.
  • Node & Entity Selection, you can select what nodes and entities to import and export. For example only export ISV Config or the Site Map. Possible items to select, 

EntitiesWorkflowsRolesISV Config
SitemapTemplatesCalendar SettingsGeneral Settings
Email SettingsMarketing SettingsOutlook SynchronizationAutoNumbering Settings
And more…

  • JavaScript Export/Import, This allows you to extract JavaScript to a local folder, where you can work in a proper script editor, and later import them back. You can also create new javascripts in the same folder, just follow the name convention and they will also be imported to the correct entity / event.
  • Zip support, Now all features works with zipped customizations
  • Include Related Entities, This features will automatically include related entities to the selected entities, so their relationships are exported and can be reviewed for conflicts. This is recommended during the development process when relationships may change.
  • Publish Workflows, Publish operation now also publishes workflows

Tuesday, March 16, 2010

CRM Identify which fields are not being used for any given crm entity

We're currently working with a customer who has a CRM 4 deployment that is deemed a failure in the business (this was implemented by another CRM ISV). One of the activities we are undertaking is to simplify the CRM forms as much as possible.

David Jennaway has a small post on identifing unused fields that will be really useful to us to provide evidence which fields are not being used, now if we could just get that data cross referenced with the fields that are actually on the forms or in views....

Use the following SQL to create the stored procedure:
create proc pExcCheckColumnValues @entityName nvarchar(64), @customOnly bit = 0, @maxThreshold int = null

declare @attrName nvarchar(50), @sql nvarchar(1024)
declare cur cursor fast_forward for
select from attribute a

join entity e on a.entityid = e.entityid
where = @entityName and a.IsLogical = 0 
and ((@customOnly = 1 and a.IsCustomField = 1) or isnull(@customOnly, 0) = 0)

create table #tmp (EntityName nvarchar(64), AttributeName nvarchar(50), ValueCount int)

open cur
fetch next from cur into @attrName
while @@fetch_status = 0
 set @sql = 'insert #tmp select ''' + @entityName + ''', ''' + @attrName + ''', count(*) from Filtered' + @entityName + ' where ' + @attrName + ' is not null' 
+ case when @maxThreshold is not null then ' having count(*) <= ' + cast(@maxThreshold as nvarchar) else '' end 
 exec (@sql)
 fetch next from cur into @attrName

close cur
deallocate cur
select * from #tmp

To give an example of how to use the procedure, the following will return all custom attributes of the account, where no more than 10 account records have a value in this field:

exec pExcCheckColumnValues @entityName = 'account', @customOnly = 1, @maxThreshold = 10

Monday, March 15, 2010

CRM 4 : Lookup name label not being displayed

I've had an issue for the last couple of weeks that has been difficult to resolve. When users were trying to populate certain lookups on some CRM forms the name was not being displayed for the selected record in the lookup records dialog, but the lookups could be populated from the form assistant. After disabling all javascript I was a bit stumped to see the issue was still present.

I've been using a tool called CRM View Layout replicator to copy the columns in one view to other views. It turns out there is a bug in this tool and when it updates the "lookup view" it updated the preview attribute in the customisation xml, it set it's value to 1 instead of keeping it's origin value of 0. When you select an entity form the lookup records dialog, the system uses the view where preview value is 0 to find the name of a selected entity and populate it in to the lookup on the form.

The fix is to export the entity xml and update preview="1" to preview="0" for all the lookup views (1 per entity) that the tool has been used against and then reimport the xml again.

Here's an example where the preview attribute is incorrect:

Friday, March 12, 2010

CRM 4 Import Organisation fails

Today I had an issue where I could not import an organisation into CRM4, I could not get past the map user screen. I found a good forum post but it still didn't resolve the issue my issue.

The import wizard needs the setup user mapped, the setup user is the user that originally created the organisation, if the user has been disabled, or CRM system administrator rights removed then there can be problems during the import process, the below script put's things right. In fact it can even change the setup user if required.

This script will just list all the users and their security roles,

Use this script to set a user as the setup user, just update the set statement with the domain user name and run against the database you want to import.

SET @NewSetupUserDomainName = 'CRM\Administrator'

How to change the user name and the logon name for a user record in Microsoft Dynamics CRM

If you change the logon name of a Microsoft Dynamics CRM user record in Active Directory, Microsoft Dynamics CRM can no longer use the logon name to locate the user in Active Directory. Therefore, the Microsoft Dynamics CRM user cannot log on to Microsoft Dynamics CRM.

To make sure that a user can successfully log on to Microsoft Dynamics CRM, change the user name and the logon name for the user record in Microsoft Dynamics CRM. To do this, follow the appropriate steps.

Microsoft Dynamics CRM 4.0

  1. Modify the user account in Active Directory. For example, change the user name, and then change the logon name.
  2. Open Microsoft Dynamics CRM 4.0 as a System Administrator user.
  3. Click Settings, click Administration, click Users, and then open the user record that you want to change.
  4. In the Domain Logon Name box, type an Active Directory user account that is not used by a Microsoft Dynamics CRM 4.0 user record.

    Note If all the Active Directory user accounts are used by Microsoft Dynamics CRM 4.0 user records, create a temporary Active Directory user account.
  5. Click Save.
  6. In the Domain Logon Name box, type the Active Directory user account. Then, click Save and Close

    Note The Active Directory user account that you type in this step is the account that is used by a Microsoft Dynamics CRM 4.0 user record. The Microsoft Dynamics CRM 4.0 user record is the record for which you want to change the user name and the logon name in Microsoft Dynamics CRM 4.0.


Tuesday, March 09, 2010

Great Book Professional Enterprise.NET (Wrox Programmer to Programmer)

I've just finished reading this book and thought I'd share my thoughts.

Having read Head First Design patterns, (which I think has a unique and great way of teaching patterns), I still couldn't manage to get the patterns in my code. This book however, has finally allowed me to clearly identify and implement some useful patterns in my code, some I was already using but didn't realise! It offers clear explanations of why and how to organise your code into a clear and testable manor. The book has three distinct sections with a total of 12 chapters and presented in a good logical order.

Part I, an Introduction to Practical Enterprise Development, covers the question why and what enterprise architecture and development is, these chapters cover the concepts of enterprise architecture and development talking about Reliability, Flexibility, Separations of Concerns, reusability and maintainability.

Part II, the New Code -- Changing the Way You Build, shows you how you can write and organise your code to support the concepts discussed in part I. It also offers practical learning covering many key concepts in a logical order, amongst other things you will learn about loose coupling, refactoring, TDD, mocking, abstraction, unit testing and a variety of patterns.

Part III, Enterprise Design Patterns, this was the meat for me, effectively covers various design patterns and tools that can be used. For me, some of the best content is in this section, I especially liked the Model-View-Presenter and Model-View-Controller patterns, this part of the book explains why and when these patterns can be used.

In Summary, I would definitely recommend this book, it's a worthwhile read. It taught me so much about what's available out there and what's being used now in software development and will stay as a hands on reference resource going forward.