
You need to sign in to do that
Don't have an account?

Illegal format string to date .

![]() |
The marked field is where i should be update the value frim the custome object. The surveydate in custom object is string type and the Survey_Dt__c field is a date field. and should be able to add days or change the date so i want to pass the line of code for date as a string and pick it up in my class to update it with that date.
Please suggest thanks in advance.
|
|
You might want to check the format in which the string dates are stored. Possibly also add a not null check, because if the string dates happened to be null on any records, they would return an Invalid Date Exception.
Salesforce accepts the YYYY-MM-DD as a valid format for dates (though there is something about locales and valid date formats)
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_date.htm