Cannot insert the value NULL into column 'InvoiceNumber', table 'MDCRMDEMO_MSCRM.dbo.InvoiceBase'; column does not allow nulls. UPDATE fails.Invalid length parameter passed to the SUBSTRING function.
Cannot insert the value NULL into column 'InvoiceNumber', table

This happened recently on a hosted server, just for fun I thought I'd see if I can find the sql script that's doing it.
- Download rollup 8 or 9, I downloaded 8
- Download & Install WinRAR
- Extract rollup by right clicking the update exe -> Extract to ...
- Go into the following extracted directory CRMv4.0-*-i386-Server-ENU\en\kb975995\install
- Open up dbhotfix_9007.sql in notepad
You have couple of options, you can either comment out line 24 to line 49, or simply add another where clause to line 17 so that it doesn't select any records, eg: " AND 1=2", once that's done run crmupdatewrapper.exe.
You might see a similar error with Rollup 9 regarding timezones, do the same as above, find the sql script, comment it out or add a IF check so it doesn't try to insert the record twice.
Time for another crm goodie...
Here's a quick and dirty way of making tasks recur in dynamics crm using couple of attributes and a workflow!

Required Attributes
Workflow

How does it work?
First we set the 'Recur' flag to yes to indicate that this is a recurring task, then we have a simple workflow that watches the task and waits until it's status changes, eg: completed, canceled...etc, if it detects that this task is complete it does another check to see if the 'Stop Recurring' date is beyond the current date; which is the modified on date (not accurate since workflows are asynchronous, but this is good enough and works without having to open visual studio!). It then creates another task with the same information and sets the Recur flag to yes, sets the same Stop Recurring On date, once that task gets marked as completed another cycle of the workflow executes making it a recurring task until the Stop Recurring date is reached.
Enjoy!
The team that wrote the dynamics crm sdk help rocks!
I wanted to display the same crm icons on our time tracking application for consistency, so I opened up the sdk help file, searched for 'icon', ignored all the sitemap/isv config entries since I know I want to get these icons programatically, about half way down the search results I see 'organizationui', sure enough that contains the 16x16 (gridicon), 32x32 (outlookshortcuticon) and 66x48 (largeentityicon) icons!
To get all the entities, execute a retrieve multiple request.
RetrieveMultipleRequest request = new RetrieveMultipleRequest
{ Query = new QueryExpression
{ EntityName = "organizationui",
ColumnSet = new ColumnSet(new[] { "objecttypecode", "formxml", "gridicon" }), }
};
var response = sdk.Execute(request) as RetrieveMultipleResponse;
Now you have all the entities and icons, here's the tricky part, all the custom entities in crm store the icons inside gridicon, outlookshortcuticon and largeentityicon attributes, the built-in entity icons are stored inside the /_imgs/ folder with the format of /_imgs/ico_16_xxxx.gif (gridicon), with xxxx being the entity type code. The entity type code is not stored inside an attribute of organizationui, however you can get it by looking at the formxml attribute objecttypecode xml attribute.
response.BusinessEntityCollection.BusinessEntities.ToList()
.Cast<organizationui>().ToList()
.ForEach(a =>
{ try
{ // easy way to check if it's a custom entity
if (!string.IsNullOrEmpty(a.gridicon))
{ byte[] gif = Convert.FromBase64String(a.gridicon);
}
else
{ // built-in entity
if (!string.IsNullOrEmpty(a.formxml))
{ int start = a.formxml.IndexOf("objecttypecode=\"") + 16; int end = a.formxml.IndexOf("\"", start);
// found the entity type code
string code = a.formxml.Substring(start, end - start);
string url = string.Format("/_imgs/ico_16_{0}.gif", code);Enjoy!