function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
skyfjskyfj 

Why date type field can't save?

Hello,everyone:

 

      I have met a question:

            testStudent.Birthday__c = Convert.ToDateTime("2000/02/03");

      Birthday__c is the Date type field, but I can't save it, is there anyone can give some advises?

 

Sincerely

 

skyfj

NewbsterNewbster

Have you tried  "02/03/2000"

 

?

SuperfellSuperfell
http://community.salesforce.com/sforce/board/message?board.id=NET_development&message.id=815
skyfjskyfj

Dear Simon:

       Thank you very much.According to your hint,That problem has solved.

       Actually, I only can save string type data, the double and bool type data can't save yesterday.But now I can save them.

       I wonder why string type data can directly save,but double and bool and date type data can't.

       

       That's ok, the problem has already solved. Thank you very much.

 

 

Sincerely

 

skyfj

 

       

skyfjskyfj

Dear Newbster:

        Thank you for answering my problem. I didn't try like you said. but  now, I have already solved it.  the datetime,double,bool type data need also  set "Specified" propery,but I don't know why have to do like that.

now , the blew is my codes:

 

        testStudent.Birthday__c = Convert.ToDateTime(arrValues[2].ToString());
        testStudent.Birthday__cSpecified = true; 

 

 

Sincerely

skyfj