woensdag 4 juni 2008

Putting a DateTime value in a CrmDateTime field

When you want to assign a DateTime value to a CrmDateTime field while using the Webservice API it is not as simple as converting the DateTime field to a string and assigning the value.

The string has to be in a specific format.

Example:
CrmDateTime sEndDate = new CrmDateTime(MyDateTimeValue.ToString());

The above will NOT work.
Format the DateTime with the following format.

CrmDateTime sEndDate = new CrmDateTime(MyDateTimeValue.ToString("s"));

Geen opmerkingen: