You need to sign in to do that
Don't have an account?
oofoofoof
How to re-format date/time field?
I have a custom link on a page that takes me to the edit page of another custom object. I want to pre-populate the fields on the new page with data from the originating page. I'm having trouble with a date/time field. The receiving field needs the date/time to be formatted as MM/DD/YYYY HH:MM AM/PM,
but when I use the merge field from the sending page as follows:
parent.frames.location.replace(...&00NT0000000upfz={!Event.ActivityDateTime}...
the date in the receiving field shows up as MM/DD/YYYY, so I get "Error: Invalid Date and Time" in the receiving field.
I tried assigning {!Event.ActivityDateTime} to a javascript variable, but the assignment does not produce the Date object. How do I format the sending date/time to be acceptable to the receiving field?
Rapidly you have to store your event in a javascript stringa and then try to create a date with the correct parameters as your date type wanted.
Try this at first and give the results
Cheers
assigning to string gives the same result.
var x = "{!Event.ActivityDateTime}"; alert(x)
shows up as "3/1/2007"
The workaround I am using is to extract the ActivityDateTime from the DB using soql, creating a JS Date, assigning UTCHours() UTCMinutes() to the JS Date and then extracting time in localtime. It works, but is ugly.