Microsoft CRM : modify the default types of form entities

At work we use Microsoft’s CRM 3 for project management as well as customer service. It’s the only thing keeping the PC under my desk, as it requires IE on a PC. Like all other out-of-the-pandora’s-box software products, CRM tries to be everything to everyone. Incredible bloated, slow, but super duper customizable.

When entering Tasks and alerting task completion by Email, the defaults are not set up logically, at least not for the way I work:
CRM’s default type for REGARDING is Account. The default for TO is account. The default for BCC is account.
That leads to a lot of wasted time selecting the type I want then doing a search. Doubly so in CRM since it’s web based. Every action is a new page load. And CRM for some reason is very slow at the beginning of a session. Ideally, the defaults should be:
REGARDING: case (what I’m working on), TO: contact (the client), BCC: user (my boss)

Using CRM’s robust customization tools, it is possible to achieve just that…

Click ‘Settings’ on the bottom left of the main window.

Click ‘Customization’ on the top left under Settings.

Click ‘Customize Entities’ in the main area under Customization.

Set the View to ‘Customizable Entities’. Scroll down and double-click Email. A window will pop up.

Click ‘Forms and Views’ in the top left under Details

Double-click ‘Form’ in the list. Another pop up window.

Click Form Properties on the bottom right. Another pop up window.

Select Onload, then Edit. Another pop up window – this is a Microsoft product after all.

Tick the ‘Event is enabled’ checkbox’. Enter the javascript:
    crmForm.all.regardingobjectid.defaulttype = “112”; //case = “2”; //contact
    crmForm.all.bcc.defaulttype = “8”; //user

Click OK.
Click OK again.
Click ‘Save & Close’.
Click ‘Save & Close’ again. Did I mention this is a Microsoft product?
Click ‘Publish’

Now when you compose a new email in CRM, you’ll be able to select the TO (contact), REGARDING (case), and BCC (user) much faster.

You can follow the same (relatively) steps to do the same for New Activities as well. based code deployed on Apple Inc.’s website

Wow how cool is this?

Scriptaculous’ modified version of my JS Audio Engine is being used by Apple!

// sound.js v1.7.1_beta2, Sat Apr 28 15:20:12 CEST 2007

// Copyright (c) 2005-2007 Thomas Fuchs (,
// Based on code created by Jules Gravinese (
// is freely distributable under the terms of an MIT-style license.
// For details, see the web site:

Control iTunes from a DragThing dock

While working, I use iTunes. But I find that the controller gets
obscured by other windows. Or it just plain clutters my desktop. So I wanted to get  rid of the controller but still use iTunes.

There are many utilities that will control iTunes. But I didn’t want to load another program on my development machine. However I do run DragThing on my system. I consider it as part of the OS.

If you have an iTunes icon in a dock, you can right click to show the menu and control iTunes right from there. But I didn’t like the extra step. So I came up with another solution.

Using three AppleScripts, I made it so you can controll iTunes from within a dock without any menus. All you have to do is expand the draw and click play (or next/previous). Check out the movie:

Full Size Movie : 705×312 | 2.5MB

I left the iTunes conteler up to demonstrate the functions of the buttons in DragThing. Being that everything works, you can close the iTunes controller – which does not quit iTunes or interrupt the music in any way. You’re left with a clean desktop, and quick access to iTunes from a DragThing dock. Sweet.

Compressed Prototype and Scriptaculous

Just a little site news. Don't get too excited. is now using the compressed versions of Scriptaculous and Prototype , as packaged by Steve Kallestad .

I've opted to use prototype.js 1.50 rc2 and scriptaculous 1.7 beta 2 because:

  • These versions of both packages together do not exhibit some flaws is later versions
  • This compressed version… actually works.

So go ahead and enjoy a that loads 130KB faster =)

Internet Explorer 7 breaks CFInput validation

Redmond does it again. Thanks folks.

If you use CFinput validation on a text field with a style of display:none, you’ll run into problems with IE7.

Original Code:

<cfinput type="text" name=""	required="#attributes.required#"
message="#attributes.message#"	value="#attributes.value#"

After an invalid entry of a form field is made, ColdFusion displays the error message of your choice with generated JavaScript. Upon dismissing the alert, that JavaScript then places the system carat focus on the form field in question.

In a client’s form I had a hidden form field that would hold generated values. If that form field is blank upon submission, the page shows the validation error. And it works in Mac:Safari/Firefox and PC:IE5.5/IE6. What it does NOT work in is IE7. What happens is IE chokes on the fact that form field is hidden, so it freaks out about it and shows it’s own error, which stops your ColdFusion generated JavaScript, which contains the ‘return false’, which is supposed to stop the form from being processed.

IE7 breaks CFInput

Get the picture? Your form will be submitted even after validation fails. Nice.

Onto the fix
In order to not have CF give focus to this hidden form element, we have to change the default behavior of the JavaScript. So take out the message attribute, and replace it with onError, like so:

<cfinput type="text" name=""
	onError="alert(unescape('#urlencodedformat(attributes.message)#')); return false;"

Now if the field is invalid an alert will be shown, but no focus() command will get executed. The return false simply hualts the form submission.

The only downside to this is that you’ll get an alert box for each invalid item (only one at a time though), whereas CFInput’s default action puts them all together into one alert box.
Expanding on this, you can create a JavaScript to compile all error messages… but jeez… what’s the point of CFInput then?

IE. It’s almost as bad as Safari.

Referer Cloud

Using ColdFusion I look for the referring web page that sent a viewer to my site. Then I split that traffic up into two categories: 1) Searches 2) Links. If a similar search term was seen before, I incriment it’s weight. Same goes for domains of links. The result is a Referer cloud, very similar in look to a Tag Cloud:

Referer Cloud

But I find this MUCH more interested than a tag cloud…
This shows me what terms people are searching for in order to find me. Also lets me know who is linking to me (if the link was clicked on). I find it REALLY damn intersting and fun to watch. And since it’s sorted by the last hit time descending, I get up to the instant information.

Look at how weighted ‘php reference pdf’ is… and I only have two pages on my site that mention php. It just goes to show you how popular php is, and the need for the decent PDF reference that I posted.

And notice how many of those search term referrals are from Google (mouse over the terms for info). It shows how dominant they really are.


I did a little poking around online and found other search/referer clouds. But they didn’t split the search terms out. And they counted as sepearate from, whereas my program knows to combine them as

I’ve looked at the source code of other referer cloud programs… they are up in 300 lines of code, and use server log files (not real time). My program is only 150 lines of code and uses real time cgi variables and a MySQL database.

Others: Google only. Mine: All search engines.

Less code, more functionality, better performance. =)

We’re going Global : Italy

An Italian site called posted a reference to in a blog:

Addio flash…

Ho sempre sostenuto durante le mie docenze che Flash prima o poi
avrebbe ceduto il passo ad altre tecnologie più leggere e
performanti… si hanno le prime notizie di ciò. A tal proposito
desidero segnalare questo sito che tutto usa tranne che Flash:

Roughly translated:

Goodbye flash…

I have always thought that Flash sooner or later
would be surpassed by other web technologies that are more readable by search engines and perform better… I have the first news of that. For that desired purpose, I wish to show you a site from USA that uses no Flash:

Paolo, la ringrazio per l'onorevole menziona!

Scriptaculous audio engine – based on code

The forthcoming Scriptaculous (version 1.71?) may have an audio engine. The base of which is from yours truly.
For I had built a JavaScript audio engine:

  • Start a sound at any time
  • Stop that sound any time thereafter
  • Start another sound while the previous sound(s) are playing

The result is a multi-track audio engine that is accessed through
JavaScript. It uses Scriptaculous’ Builder to create and kill sounds.

Being so excited of my accomplishment, I wrote an email to Thomas Fuchs,
creator of Scriptaculous, telling him of what I did. He asked if he can
incorporate my work into the next release, as audio.js, along side
effects.js, dragdrop.js, etc. Of course I said yes.

As always, no plug-in allowed. Well… not entirely true. But the user is never prompted to install one. So it degrades nicely on all browsers and platforms.

  • If you have a Mac, you’re all set. QuickTime takes care of all browsers.
  • If you have IE, you’re also set. bgsound is a wonderful thing – wav w/ no plug-in.
  • Opera? Terrific. Wav files with no plug-in.
  • FF on the PC? Only if you have QT installed. Otherwise you hear nothing. For now.

To come are some very nice improvements in speed and functionality.

Fancy Upload 1.0 – CSS Styled Upload Form

Sometimes a client will ask me to make a styles upload form, and of course modify the ugly ‘Browse…’ utility. But we’re very limited to styling upload forms. We cannot rearrange the buttons, nor change the ‘Browse’ label. Even with CSS the browse button and the file name field act… funky.

So I’ve come up with a way to make it appear as if we’ve styled the ‘browse…’ button and file name field… with only CSS. Since I did not specify any widths in pixels, we will have a nice cross browser solution. Then by adding some javascript we have total control of the file name, and even add an icon.

And we’re going to make it so that the fancy form only shows in a modern browser (Safari 1.0+, Firefox 1.0+, Internet Explorer 5.5+/Win, Opera 8+). It will degrade gracefully when images, JavaScript, and/or CSS are not active. The markup validates to the XHTML 1.0 Transitional DOCTYPE.

Fancy Upload
Fancy Upload

Live Demo

I’ll have this up on github shortly!