June 9, 2008

After saving an account, this message popped up. And you guessed it - it appeared just SOMETIMES!

After a little of SQL profiling i found the reason:I extended the account's address1_line1 field from 50 to 100 characters. After saving the account, CRM automatically creates/updates also the customeraddress entity.

Now let's delete the duplicates. The semicolon at the beginning is recommended if you are not using it after every SQL sentence. This tells the parser to begin with new statement. Without it you will probably get a syntax error.;WITH Numbered AS (SELECT RowNo=ROW_NUMBER() OVER (PARTITION BY ID ORDER BY ID), ID, KeyValue FROM #new) DELETE FROM Numbered where RowNo>1;

March 3, 2008

If you are writing custom workflow activities for workflows in CRM 4.0 you will find this snippet handy.

Copy the code below into a new file and name it CRMParameter.snippet. Save the file into Visual Studio 2005\Code Snippets\Visual C#\My Code Snippets folder. It works in VS2008 too.The shortcut for the snippet is cwp.

Compiler error is: Type of conditional expression cannot be determined because there is no implicit conversion between '' and 'System.DateTime'

Remember: My variable is nullable!!!

Update:David defined this problem as a feature. But aren't both examples the same? Isn't this just a compile thing to convert from the first example to the second one?I think it has to do something with nullable types, because with string or byte[] it works like a charm:string title = factRow.IsTitleNull() ? null : factRow.Title;byte[] picture = factRow.IsPictureNull() ? null : factRow.Picutre;