Merry Christmas!

Everybody,

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!

Ronald



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: http://www.stunnware.com/Products/FLD4/Default.htm



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!

Ronald



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!



Maximum amount of records in Excel export

I'm very busy at the moment (just like you all probably), so just a small post. The default for the Excel export is a maximum of 10.000 records. If you need to export more, then you'd need to modify a registery setting. Follow the next steps to achieve this:

- Start Regedit
- Navigate to HKLMachine\Software\Microsoft\MSCRM
- Create a new DWORD value named 'maxrecordsforexporttoexcel'
- Give the new value any value (minimum is 500)

Ronald



Clear BizTalk Messagebox

Since the release of the CRM - BizTalk connector, you're all doing integrations right? Did it happen to you that you start a BizTalk application one evening and in the morning your messagebox is filled with more then 100.000 instances? If that is the case, then you can delete these by using the BizTalk Administration console. Unfortunately this will take hours and hours..

Instead, running this code on the BizTalk databases solves the issue for you:


DELETE FROM BizTalkMsgBoxDb.Instances
GO
DELETE FROM BizTalkMsgBoxDb.InstancesSuspended
GO


Keep in mind that you should only do this on development, test and acceptation, NEVER on production.



Reporting services on another machine

The database server doesn't have to be running on the same server as the CRM application itself. If you follow the installation guide, then everything should work fine. But... Avanade has done this for several clients and sometimes it appears that the reporting might not work. The error message will be:

“An error has occurred. For more information, contact your system administrator”
or
"error 401 – Unauthorized access"

If this is the case in your situation as well, then take a look at the following steps.

First you have to enable Kerberos Authentication for IIS on the CRM Server.
- Open a DOS box and browse to c:\inetpub\adminscripts
- Run the command: cscript adsutil.vbs set w3svc/1/NTAuthenticationProviders "Negotiate,NTLM" (If only one website is running you can use 1 in the commandline. Otherwise you have to check the logfile directory to see what number you should use)
- IISRESET

If your services run with the "network service" account you have to open ADSIEDIT and open the propeties of the CRM server. Go to SPN settings and add the next lines:
(Computername is your CRM server and FQDN is your Fully Qualified Domain Name)

HOST/computername
HOST/computername.FQDN
HTTP/computername
HTTP/computername.FQDN

You have to do a similar action on the SQL Server, the default instance uses port 1433
MSSQLSvc/computername:1433
MSSQLSvc/computername.FQDN:1433

Finally, on the client computer check if in Internet Explorer "Integrated Windows Authentication" is activated (under the advanced settings of the internet options)

Hope this helps you to get reporting to work as well!