You need to sign in to do that
Don't have an account?
cnewman
Updating a custom date field with the date from another custom field
Hi All,
So we have a booked training date, I'm using a button to set this as cancelled or postponed which puts the date currently in the "Booked Training Date" into another field (Original training date), however when I try and use the date from my Training_Session__c.Booked_Training_Date__c I receive an error message saying the format is not correct for the date type:
A problem with the OnClick JavaScript for this button or link was encountered:
{faultcode:'soapenv:Client', faultstring:''0.000868917576961271' is not a valid value for the type xsd:date', }
I've also put in an alert to see what my date field is outputting, as you can see above it's '0.000868917576961271' ... WHY?!?!
This is driving me round the bend, I just want to update one custom date field with the date from another field. do I need to convert it or format it?
Hopefully someone can help :)
Thanks
Chris
So we have a booked training date, I'm using a button to set this as cancelled or postponed which puts the date currently in the "Booked Training Date" into another field (Original training date), however when I try and use the date from my Training_Session__c.Booked_Training_Date__c I receive an error message saying the format is not correct for the date type:
A problem with the OnClick JavaScript for this button or link was encountered:
{faultcode:'soapenv:Client', faultstring:''0.000868917576961271' is not a valid value for the type xsd:date', }
I've also put in an alert to see what my date field is outputting, as you can see above it's '0.000868917576961271' ... WHY?!?!
This is driving me round the bend, I just want to update one custom date field with the date from another field. do I need to convert it or format it?
Hopefully someone can help :)
Thanks
Chris
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_datetime.htm
You can also find the date format of any of the date fields and store it in string variable, this way you can identify which format the system accepts
Eg : String closeddate= <field>.format();
Hope this helps !!