locked
Microsoft Dynamic CRM 4.0 - save date time RRS feed

  • Question

  • Hi,

    I am using CRM 4.0 web services...

    I am saving datetime property using following code....

     CrmDateTimeProperty estimatedStartDate = new CrmDateTimeProperty();
            estimatedStartDate.Name = "new_estimatedstartdate";
            estimatedStartDate.Value = CalEstimatedStartDate.SelectedDate;

    Here its giving me error like.. "Cannot implicitly convert type 'System.DateTime' to 'CRM.CrmDateTime'".

    I had taken calender in asp.net application.. and i want to save selected datetime into my crm field.

    Wednesday, April 4, 2012 10:00 AM

Answers

  • Had solved it... Use Following code..

    CrmDateTimeProperty estimatedStartDate = new CrmDateTimeProperty();
            estimatedStartDate.Name = "new_estimatedstartdate";
            estimatedStartDate.Value = new CRM.CrmDateTime();
            estimatedStartDate.Value.Value = Convert.ToString(CalEstimatedStartDate.SelectedDate);

    !!!

    • Marked as answer by DynamicsCRM31 Wednesday, April 4, 2012 10:10 AM
    Wednesday, April 4, 2012 10:09 AM

All replies

  • Had solved it... Use Following code..

    CrmDateTimeProperty estimatedStartDate = new CrmDateTimeProperty();
            estimatedStartDate.Name = "new_estimatedstartdate";
            estimatedStartDate.Value = new CRM.CrmDateTime();
            estimatedStartDate.Value.Value = Convert.ToString(CalEstimatedStartDate.SelectedDate);

    !!!

    • Marked as answer by DynamicsCRM31 Wednesday, April 4, 2012 10:10 AM
    Wednesday, April 4, 2012 10:09 AM
  • Hi,

    Thanks for the response.

    Thursday, April 12, 2012 10:45 AM