The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Enter date value in Service page

Highlighted
Bunny_1
Occasional Contributor

Enter date value in Service page

Hi everybody,
I am customizing Service Pages and I am trying to add a date field in the CreateIncident.jsp page.
I am able to display the Label and input a date. I am taking the inut in mmm dd, yyyy hh:mm:ss AM/PM format because when I retrived a Date field value from an existing Ticket, it displayed it in this format.

While saving the Incident, I am casting the input into a Double type and then trying to assign it to the Incident object, since, the particular method, setIncidentDate7() takes in a Double value.
But I am gettin a java.lang.NumberFormatException: May 9, 2007 9:26:56 AM exception.

Can someone please tell me, where I am going wrong and how to update a Date value?

Thanks in advance,

Anirban
2 REPLIES
Mark O'Loughlin
Honored Contributor

Re: Enter date value in Service page

Hi,

Have you also modified the SaveIncident.jsp page as well to handle the new field.
Bunny_1
Occasional Contributor

Re: Enter date value in Service page

Hi Mark,
Thanks for your response.
Yes, I have modified the SaveIncident.jsp page and that is where I am getting the error.

I am taking in the QueryString variable value, casting it to double and then trying to assign it to the Ticket.

At this point I am getting the following error,

java.lang.NumberFormatException: May 9, 2007 9:26:56 AM
at java.lang.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Double.valueOf(Unknown Source)
at java.lang.Double.(Unknown Source)
//Add this to "OnDomLoad" event