August 23, 2007

MS CRM date formats

I have been working on various aspects of Microsoft CRM. Lately, I have been trying to wrap my mind around inserting and manipulating data in MS CRM using the provided web services.

What struck me, is the lack of easily accessible example code.

I have been wrestling today with (amongst other things) how to set date fields.

I found this example code:
CrossRef.msfinint_last_updated = new
CrmDateTime();
CrossRef.msfinint_last_updated.Value =
DateTime.Now.ToString(CultureInfo.InvariantCulture);

Going to try it out tomorrow, I'll let know if it actually worked now.

(Found this code at Codeplex, in the Microsoft Dynamics CRM Connector for Sage Line 50 ... not that we use Sage, but reading actual working code always helps me understand how to do things).

EDIT: Yes, this seems to be the right way to go about this. I got the code working just fine now.