I’ve modified the Bulk Attribute Deletion Utility to support Internet Facing Deployment ( IFD ) for CRM 4.0.

Download it here.

Thanks to my friend George Doubinski I was able to connect to a CRM installation via IFD for testing.

Please let me know if you run into any issues.

 

I just ran into something that I have never seen before related to a SoapException:

I was updating my Export JavaScript utility when I received an error message that was blank.  Very odd, I thought.  After a bit of digging, I found the error:

Server was unable to process request.
—> Exception has been thrown by the target of an invocation.
—> The type initializer for 'Microsoft.Crm.WebServices.CrmAuthenticationSoapExtensionBase' threw an exception.
—> The server is not operational.

Now at this point, I really don’t know what happened, but my development CRM 4.0 server was in some type of non-functional state that required me to perform an IISRESET to recover from.  That is not the interesting thing here today.

The interesting thing is where the error message was found.  Here is an example the code that normally use to detect an error when using the CRM Web Service:

catch (SoapException ex)
{
    MessageBox.Show(ex.Detail.InnerText,
                    Properties.Resources.MSG_AN_ERROR_HAS_OCCURRED,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
}

Usually, the actual error message is found in the SoapException.Detail property and you can access it via the InnerText or InnerXml properties, depending on how you wish to handle it.

Today, the error message was actually in the SoapException.Message property, which I find very odd.  As I said, I’ve never seen this before so I don’t know what happened, but in order to prevent a blank error message from appearing to the user, I created the following work around:

catch (SoapException ex)
{
    string errorMessage = ex.Detail.InnerText;

    if (string.IsNullOrEmpty(errorMessage))
    {
        errorMessage = ex.Message;
    }

    MessageBox.Show(errorMessage,
                    Properties.Resources.MSG_AN_ERROR_HAS_OCCURRED,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
}

As you can see, I just take into account the possibility that the Detail.InnerText property is blank and if so, just use the standard Message property to be safe.

 

New Poll Released: What type of training do you prefer?

On July 24, 2010, in Misc, by Mitch Milam

I’ve added a new poll to the blog to see how people like to get trained.

If you have a few minutes, I’d like to know your opinion.

 

Hi everyone.  Well it’s been a long time since I showed you how to do something horribly unsupported so let’s do something like that today.

Background

Ad you may know, CRM allows you to pick the layout style for a section within a CRM form.  For the most part, their settings work just fine.

In January I did a short presentation on CRM User Interface tips and tricks for the XRM Virtual User’s group where I reminded everyone that even once you have picked a format for a Section, you can still change the width of the fields labels within the section.

It’s highlighted below:

image

Unfortunately, it has a maximum value of 250 pixels, which is usually fine, but what if I have a really, really, long label?

The Scenario

Let us pretend that I am creating a questionnaire inside CRM to gather some type of relevant data.  I either create a Questionnaire Entity or just add some question attributes to an existing Entity.  Either way, I have a lot of question text and not much room to show it and it might look something like this:

image

Note: This is using the default column layout for a Section.

Notice that my answers are also really small – basically Yes or No, or a short amount of textual information – and they are taking up over 50% of the Section area.

We need to fix that.

The Solution

Ok, we’re going to change the column width of both columns within the Section using JavaScript.  But let’s start with a look at the HTML that makes up our Form:

image

CRM uses something called a Column Group ( colgoup ) to help define how the columns of the table are to be sized.  As you can see from the picture above, the column that contains the label is 250 pixels wide and the column that contains our data entry field is 270 pixels wide.

Using the following JavaScript, we can modify those values to be more representative of both the data and the label requirements:

var tableObj = crmForm.all.new_q1_c.parentNode.parentNode.parentNode;
var col0 = tableObj.getElementsByTagName("col")[0];
var col2 = tableObj.getElementsByTagName("col")[2];

col0.width = "60%";
col2.width = "40%";

How This Works

 

Step 1:

First we need to get a handle to our form field’s parent table, which we do with the first line of JavaScript.  crmForm.all.new_q1_c is actually the table cell that contains the label of our first form field ( which is the attribute new_q1, by the way ).

 

Step 2:

Next we need to get the handle to the first and third col objects that belong to the parent table which we accomplish by using the getElementsByTagName function.

 

Step 3:

Once we have that information, we can set the width of the first column to 60% of the container’s space ( the table ), and set the third column width to 40%.

Your new section layout should look like this:

image

You can change the values for each column to meet your requirements.

Note: I actually have a question at the bottom of this list that occupies much of the form but it contains customer-specific information so I can’t show it.

 

Conclusion

As I mentioned, this is very unsupported and I can’t guarantee it will work in every circumstance, but it seems to fit the need I had.

Also, If you’re good with jQuery, you can probably do something very similar with less code.

 

I’ve had discussions recently with both customers and partners regarding the differences in the three editions of Microsoft Dynamics CRM 4.0 so I thought I’d quickly cover these today.

Note: For this discussion, I am purposefully not covering CRM Online since the end-customer has no control of that environment.

Editions

We have three editions available to us:

Microsoft Dynamics CRM 4.0 Workgroup.

This edition is limited to five, or fewer, users. It can be installed on Microsoft Windows Small Business Server 2003 R2 Premium Edition, any of the supported Windows Server 2003 editions, or Windows Server 2008. This version is limited to a single organization and a single computer that is running Microsoft Dynamics CRM Server.

Pretty self explanatory: 5 users, one CRM Organization.

 

Microsoft Dynamics CRM 4.0 Professional.

This edition has no user limit and is limited to a single organization. However, Microsoft Dynamics CRM 4.0 Professional can be installed on more than one computer in the same deployment.

Microsoft Dynamics CRM 4.0 Enterprise.

There is no user limit for this edition. Additional features include support for multiple organizations, multiple server instances, and role-based service installation. Role-based services let you increase performance by installing component services on different computers.

 

Why is this important?

Most companies run into issues because they purchase the Professional Edition knowing that they will always have a single organization or tenant.  Most people know that the Enterprise edition allows you to specify multiple organizations, but what is not really clear, if you don’t know the terminology, is something called role-based services.

CRM 4.0 is divided into a series of server roles that perform various tasks related to the operation of the system as a whole.  Unless instructed otherwise, when you install CRM all roles are placed on a single server, which is usually not a problem.  But, there may come a time when you need to move one of the roles to a separate server to help ease the processing burden.

And in many cases, this has nothing to do with the number of users but is totally related to what those users are doing.  Some operations, such as the application of complex business logic, batch updates, etc., may require a tremendous amount of processing power for a short period of time.  Since all of the server roles are on a single server, that one server must perform all of the processing directly.

If the server roles are split, say by moving the Asynchronous Processing service to another server, the load is shared between multiple physical machines so that one set of processes doesn’t affect others.

So, keep that in mind when you start planning your own CRM installation.

 

Licensing

A Microsoft Dynamics CRM 4.0 deployment operates by using a single license key. Unlike earlier versions, Microsoft Dynamics CRM 4.0 no longer requires additional license keys to be added when changes are made, such as adding a client access license (CAL). The single license key contains the Microsoft Dynamics CRM version, server license, and the CALs.

You can view and upgrade a license in Deployment Manager.

You can view and modify client access license types for each user in the Users area of the Settings area in the Microsoft Dynamics CRM Web client.

Note: There is no difference in the licensing for the CRM Clients, no matter which edition of Dynamics CRM 4.0 you have installed.

 

References

 

I took a break from recording some training videos tonight to record a quick screencast of the Marketing List Manager solution I created for CRM 4.0.

I walk you through creating workflows that use the Marketing List Manager to add and remove a Contact from a marketing list.

You may view it here, under the Additional Downloads section.

 

I ran into an interesting requirement this morning that let’s me show off one of my favorite CRM add-on utilities: Stunnware Tools.  Let’s cover both.

The Requirement

I needed to create a list of users that were members of a specific security role.  Rather than writing an application or designing a SQL query, I opened Stunnware Tools for Microsoft Dynamics CRM so that I could create a query in the FetchXML Wizard.

Using the FetchXML Wizard

The FetchXML Wizard allows you to query CRM by building a FetchXML query.  Here is a screen shot of the Designer:

image

 

Designing the Query

The following steps were required to created the desired query:

Step 1:

Query the SystemUser entity and return the Full Name of the user.

Step 2:

Include a Linked Entity that links the SystemUser Entity to the SystemUserRoles Entity

Step 3:

Add another Linked Entity from SystemUserRoles to Role.  This link will have a filter applied where the Name of the Role is equal to salesperson.

Here is the resulting FetchXML query:

<fetch mapping="logical" count="50" version="1.0">
  <entity name="systemuser">
    <attribute name="fullname" />
    <link-entity name="systemuserroles" from="systemuserid" to="systemuserid">
      <link-entity name="role" from="roleid" to="roleid">
        <filter>
          <condition attribute="name" operator="eq" value="salesperson" />
        </filter>
      </link-entity>
    </link-entity>
  </entity>
</fetch>

Which produces the following result set:

image

 

This whole process took me less than 5 minutes because the FetchXML Wizard Query Designer understands the links between CRM Entities and allowed me to quickly select those links and specify the necessary filter to produce the dataset I needed.

The Export to Excel module included in Stunnware Tools allows me to export the above result set to an Excel worksheet.

More About Stunnware Tools

There are two editions:

  • The Community Edition: It's free and contains the Metadata Viewer, FetchXml Wizard and Excel Export.
  • The Professional Edition: A subscription-based version with access to all tools of the Community Edition plus the Code Generator for C# and VB.NET, the CRM Help File Generator, additional features of the FetchXml wizard and the Customization Comparer.

Stunnware Tools is probably the most valuable Dynamics CRM add-on that I have.  I use it on a weekly, if not daily basis and which makes me a much more productive developer.

 

I’ve released a new free utility for CRM users that allows you to bulk-delete CRM Entity Attributes.

The user interface is fairly straightforward, as you can see below:

image

How It Works

The operation is pretty simple:

1) Select if your organization is OnPremise or CRM Online.

2) Enter the name of your server and the credentials required to connect properly.

3) Select the organization you wish to connect to.

4) Select the Entity you wish to delete attributes from.

5) Select the attributes to delete.

6) Click the delete button.

 

Behind the Scenes

This utility uses standard CRM SDK methods to delete the attributes you specify.  A log file is written to the location where the application is stored.  All actions will be logged and if errors are encountered, the log file will be displayed at the end of the processing cycle so you can see what happened.

Remember: The same rules that would apply if you were to delete an attribute through the CRM user interface apply here.  For example: if the attribute is used on a form, a view, or within a workflow, the deletion will fail and you will be given a list of locations where the attribute is in use.  You must remove the attribute from those locations before you can continue.

 

Download

You may download it here.

 
 

I have been dabbling a bit with iPhone development as a way to stretch my development skills.  Unfortunately,Apple’s language of choice for iPhone/iPad development is something called Objective C which, for me anyway, is a time machine straight back to 1989 or so.

Now I really have nothing against Objective C besides that fact that my brain is full and that I don’t want to learn yet another language.  So, when Novell announced MonoTouch last year, I was ecstatic.  Here was a tool that would let me use my existing C# and .NET skills to write applications for the iPhone.  That meant that all I worry about was the iPhone development environment and tools and that my hard-earned .NET knowledge would stay in place.

Documentation and examples were light at first but that void has been quickly filled by the MonoTouch team and a variety of bloggers. But what was really missing was a really great MonoTouch book.  Thankfully, one arrived last week, written by some of the same folks that have been blogging about MonoTouch since beta": Wallace (Wally) B. McClure, Martin Bowling, Craig Dunn, Chris Hardy, and Rory Blyth.

Overview

Here’s a quick overview of the books contents:

  • Exploring the screen controls
  • Working with data, controls, and tables
  • Mappings
  • Application Settings
  • Working with the device hardware
  • Working with multimedia
  • Talking to other applications
  • Localizing
  • Programming the iPad
  • Just enough Objective C
  • How to work with the Apple App Store

Details

The book is really good at showing you the user interface as well as the behind the scenes code that makes certain things happen.  For me, that really ties things together.  They also show how to use the development tools to add functionality to an iPhone application while also showing how to perform the same task, strictly through code – another thing that I really like.

Finally, as with all Wrox books, you can download the source to the examples found in the book.  This book’s samples are found here.

This is a great book for a .NET developer who wants to branch out.  It’s not huge, 350 pages or so, but it will take me a while to work my way though it as I try out the examples and get used to the new programming tools and environment.