CRM news and views from Simon Jackson

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.

Labels:

Sunday, February 07, 2010

CRM 4 Multi Entity Type Lookup

Create a single lookup on a CRM form that allows the user to select from multiple entity types. Download these two entities to see this in action.



The code is a class that you can implement, so it really should be easy to use. To use the class do the following steps:

On the entity that requires the multi entity type lookup:


  1. Add a N:1 relationship for each entity type that you want in the lookup.

  2. Add the look ups to the form, add one where you want the Multi Entity Type and the others to tab that we will hide from the user.


  3. In the onload paste in the class at the top:

  4. Call the class to setup the lookup



  5. Call the onsave method


  6. Please let me know if you find this useful by posting a comment.

Labels: ,

Adding a browse button (html input file control) to a CRM form

Here's a quick example of how to put a browse button (html input file control) on a CRM form and then populate another field when it changed. Put this into your onload and update the field name 'new_filepath' in the inputF_onChange method to the name of the field that you would to be populated with the full path.

inputF = document.createElement('input');
inputF.type = 'file';
inputF.onchange = inputF_onChange;

tbl = crmForm.all.tab0.getElementsByTagName('table');
if (tbl && tbl[0]) tbl[0].parentNode.insertBefore(inputF, tbl[0]);


function  inputF_onChange() {
if (inputF && inputF.value)
crmForm.all.new_filepath.DataValue = inputF.value;
}

Here's a list the members exposed by the input type=file object.
http://msdn.microsoft.com/en-us/library/ms535263(VS.85).aspx

It should be noted that the above example will not work for IE8 as JavaScript can no longer read the full path from the value property.

As an alternative I would recommend trying a more supported method, for example, create an ISV page with the input file control and read the path server side and use javascript to populate the control on the parent CRM form.

Labels: ,

Thursday, February 04, 2010

Microsoft CRM 4.0 Update Rollup 7 and "Internet Explorer has blocked this site from using an ActiveX control in an unsafe manner."

Rollup 7 adds a new “Configure CRM” button to setup the Outlook client. The button uses an ActiveX control to read your CRM Outlook client, which can causes IE to display "Internet Explorer has blocked this site from using an ActiveX control in an unsafe manner."

This occurs when you have the Microsoft Office Outlook installed but not configured, or if you are connecting to an organisation other than the organisation for which Microsoft Dynamics CRM for Microsoft Office Outlook is configured.


This issue is mentioned in http://support.microsoft.com/default.aspx/kb/976539


A solution is mentioned here http://support.microsoft.com/kb/2004601


You can either change the IE security zone on the client or update the registry on the server. To update the sever registry, follow these steps:

  1. Open Regedit
  2. Navigate to:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM
  3. A a new 32bit DWORD called DisableOutlookSetupLink
  4. Set the value to 1 to disable the CRM for Outlook button for all users.

Labels: ,

Wednesday, February 03, 2010

about:blank not always trusted, so not such a good default url for your CRM IFrame

Basically when setting a default page for your Crm Forms IFRAME about:blank can have a trust issues in the browser and it's better practice to use /_static/blank.htm instead.

This nice article from those ascentium guys explains why.
http://xrm.ascentium.com/blog/crm/Post612.aspx

Labels:

Sunday, October 25, 2009

Excellent Calendar Control

I implemented a shared calendar view for CRM4 at a client, it shows appointments across many different business units and account in consolidated views, we used a third party share point web part by Bamboo Solutions, unfortunately there were many limitations to the control that meant that the implementation was lacking in features, such as adding a new appointment from the control!!

I've come across an excellent calendar control leaving me in doubt that if we ever have to implement a calendar for CRM again this is the control we will use.

Feature rich, excellent usability for the user and relatively cheap. There's a demo page here

Labels: ,

Monday, November 03, 2008

Optimising VPC Speed

I've started to use the following batch file to stop some unnecessary services in my CRM development virtual machine to help optimise it's speed.

As you can see below this is not specific to CRM so will come in handy for my other environments.

@echo off
@echo -- Stopping unnecessary services for optimal VPC speed
@echo
@echo -- ... Stopping "Help and Support" service
net stop "Help and Support"
@echo -- ... Stopping "Print Spooler" service
net stop "Print Spooler"
@echo -- ... Stopping "Error Reporting Service" service
net stop "Error Reporting Service"
@echo -- ... Stopping "Task Scheduler" service
net stop "Task Scheduler"

Labels: ,

Wednesday, October 22, 2008

Crm Tracing on Server 2008 problem

I was pulling my hair out trying to get Crm4 tracing working on Server 2008 deployment, I logged onto the server made changes to the tracing registry settings but CRM did create any tracing files. So I double checked them all seemed ok!

At first I thought it was permissions to the trace directory but it transpires this was caused by User Account Control(UAC) virtualising the registry.

http://msdn.microsoft.com/en-us/library/aa965884.aspx

While the registry looked fine to my user account it was a virtual copy! CRM was reading the registry but it didn’t have any trace settings.

Turning off the registry virtualises for the CRM keys, this meant I could change the trace settings. I ran the following from an administrator console to turn off visualisation

REG FLAGS HKLM\Software\Microsoft\MSCRM SET DONT_VIRTUALIZE /s

Alternately I think I could have made the changes to the registry under the context of the CRM Application Process so that CRM would see the changes.

Labels: , ,

CreateCrmService incorrect url, CrmService fails with 404 - Not Found

I deployed a plug-in today to one of our clients dev server only to get a strange “404 - Not Found” exception being reported. The exception was raised from the CrmService, the service object was returned from context.CreateCrmService so it should of been ok. Digging deeper I could see that the URL was pointing to localhost which is incorrect as it should have been the host header http://crm.mydomain.fqdn, as always Google had the answer.

I found a great post where George Doubinski has reflected the issue and highlights the CRM bug

There’s a hot-fix for the issue kb950542 at the time of writing this had to be requested from MS.

Labels: , ,

Sunday, August 31, 2008

CRM4 JScript Export Tool

Joris Kalz has released a small tool to extract the JScript from CRM forms and put them into individual files. His post can be found here.

IMHO I think I'll find this useful for source control and handy when used in conjunction with David Yack's JScript Intellisence solution.

Labels: ,