locked
CrmDateTime Problems RRS feed

  • Question

  • I don"t know why when i add this Line Code " send = dta.AddMonths(18);"

     

    I don"t See any Record that Create AND I don"t get any Errror at srv.Create (myphonecall);

     

    if i delete  " send = dta.AddMonths(18);"  its create the record with the crm but date eq to Now

     

    How Can Add 18 AddMonths???????

     

    ////////////////////MY CODE///////////////////////////////////////

    DateTime dta = new DateTime();

    DateTime send = new DateTime();

    dta = DateTime.Now;

    send = dta;

    send = dta.AddMonths(18);

    CrmDateTime dateTime = new CrmDateTime();

    dateTime.Value = send.ToString("s");

    myphonecall.scheduledend = new CrmDateTime ();

    myphonecall.scheduledend = dateTime;

     

    srv.Create (myphonecall);

     

    //////////////////////////////////////////////////////////////

     

    Wednesday, July 23, 2008 2:42 PM

Answers

  • Try changing this line:

     

       myphonecall.scheduledend = dateTime;

     

    to this:

     

       myphonecall.scheduledend.Value = dateTime;

     

    I think referencing the Value property is required. Give that a try and let us know.

     

    -Tim

    Thursday, July 24, 2008 1:02 AM