Merry Christmas!


Thanks for reading this blog another year long. Now its time for me to stop working this year. We just won a nice new project, the MS CRM Outlook V3C has just been released and so it is time to start a great holiday. I'll spend a lot of time with my friends, family and above all my wonderfull girlfriend.

I wish you all a very good time around both christmas and new year. I hope you can all enjoy the time with your relatives and hope to see you next year again!


Filter data in a CRM lookup field

Curt Spanburgh posted this message on the Sandbox: Custom Lookup Dialog for Microsoft Dynamics CRM 3.

In this post he describes that it is possible to filter the data in a lookup box. He also gives an example which uses data on the form to filter the lookup data. For testing purposes I have used the code below. It should be placed in the form onload of the account entity. It does filter the lookup parent account and will only show accounts which do have a parent account already. Not necessarily useful in a business case, but it does give you a clear example.

crmForm.all.parentaccountid.lookupbrowse = 1;
crmForm.all.parentaccountid.additionalparams = "fetchXml=<fetch mapping='logical'><entity name='account'><all-attributes/><order attribute='name' descending='false'/><filter type='and'><condition attribute='parentaccountid' operator='not-null'/></filter></entity></fetch>";
crmForm.all.parentaccountid.additionalparams += "&selObjects=1&findValue=0";

As you can see, some extra values are sent to the additionalparams attribute. These are selObjects and findValue. The selObjects should be set to the enity id of the lookup its entity.

To help you create fetchXml queries look here: Using Advanced Find for FetchXml

Great tip Curt!

Update: This does not work in CRM 4.0. Instead, look at the add-on as developed by Stunnware:

Developing on multiple VPC's

Hi guys,

I'm wondering what technologies you're using for developing CRM projects. Especially when you have multiple clients..

Personally I use virtual machines via Virtual PC. Each PC is about 10 gb huge though. So I was looking around on the internet and I found a good solution to that. Now this is what I do:

- Create one VPC which has Windows Server 2003, MSSQL, CRM, Sharepoint, Office, Visual Studio etc
- Shutdown that VPC and mark the harddisk file as read only
- Create a new VPC based on that harddisk with a check set at 'Enable undo disk' (and RAM adjusted to something like 1400 mb)
- Modify CRM to meet the customer needs
- Shutdown the VPC by using 'Save State and Save Changes'
- Make sure that 'Commit changes to the virtual harddisk' is UNCHECKED
- Select 'OK'

By doing so, you would only need 1 huge VPC and the rest are small files of about 500 mb till 2 gb. That saves me sooo much space and time! If somebody asks me a question and I dont have crm at hand, then just create a new vpc, start it (that takes a while though), run the test and remove the undo disk. Done!

You can use the Public demo VPC by Microsoft, but keep in mind that there are modifications made to that VPC which you should undo first.

Hope this helps you as well!


Set a default entity on a lookup window

In case you have more entities to chose from on a lookup window, then you might want to be able to set the default for this lookup. For instance, the regarding field on an activity entity like letter, email and fax does support multiple entities. If you want this to default set to contact, then use this javascript on the form onload:

//set default
crmForm.all.regardingobjectid.defaulttype = "2";

Even better, what if you dont want your user to be able to choose any entity and force them to use the contact entity? Then use this script:

//set only contact
crmForm.all.regardingobjectid.lookuptypes = "2";

//set icon
crmForm.all.regardingobjectid.lookuptypeIcons = "/_imgs/ico_16_2.gif";

Dont forget to set the icon. The icon will be displayed in front of the selected name after a selection in the lookup box has been made.

For a custom entity, then mind that the icon does not work that easily. Use this script for custom entities:

//set only contact
crmForm.all.regardingobjectid.lookuptypes = "10003";

//set icon
crmForm.all.regardingobjectid.lookuptypeIcons = "/_imgs/icon.aspx?objectTypeCode=10003&iconType=GridIcon&inProduction=1&cache=1";

Good luck!