So we writing a dialog this week in CRM 2011, fantastic stuff, it has some great features allow you to show pick lists of options and getting the user to select one.
but it also has some major weaknesses like the fact you can’t store dates in Dialog, you also can’t store
Bit, Date, Lookups
This seems a bit of an oversight, not to mention you can’t use custom workflow on CRM 2011 online
So to get round this we have stored the dates as text and then convert them into dates. So I need some code to convert Strings into Dates in my plugin and here it is.
newPlac.hosk_startdatetext = "20/04/2011"; newPlac.hosk_enddatetext = "21/04/2011"; DateTime startDate = Convert.ToDateTime(newPlac.hosk_startdatetext); DateTime endDate = Convert.ToDateTime(newPlac.hosk_enddatetext); The import part is using the Convert.ToDateTime(); This is overloaded so you can specify the format if you want.