Date/Time type field is throwing error of "Invalid Date" after Helsinki upgrade while creating a ticket

Gulzar Manuja2
Kilo Guru

Hello Everyone,

We have upgraded to Helsinki version from Fuji version in one of the ServiceNow environments and while creating a ticket in this newly upgraded env, I am getting an error while submitting the ticket as shown below:

find_real_file.png

"Requested Due Date" field is of type "Data/Time" and there is a client script that is hiding the time for this field. Now after filling other details on the form, when I am trying to submit this ticket, I am getting the error "The following fields contain invalid text: Requested Due Date".

But when I am creating same ticket in some other env(with version Fuji) with same details and that environment has the same client script(which hides the time) applied, I am able to submit the ticket and a record is created successfully.

Please advise me why I am getting the error in the Helsinki environment.

Any help is highly appreciated.

Thanks & Regards,

Gulzar Manuja

25 REPLIES 25

jayr
Tera Contributor

Hey Gulzar,



I'm having a similar issue - my request is submitted correctly, but when I go into one of the catalog tasks (which shows the date variable) and I try to navigate to a reference field, I get the error 50% of the times.



Did you figure out what the problem was?


thirschi
Tera Expert

I created an incident with SN and was offered this Validate Script(sys_script_validator) named Date/Time



Copy in this script and change the field (Replace on Upgrade) on the sys_update_xml table to get future upgrade to this script.



function validate(value) {


// empty fields are still valid dates


if(!value)


return true;



// We "should" have the global date format defined always defined. but there's always that edge case...


if(typeof g_user_date_time_format !== 'undefined')


return isDate(value, g_user_date_time_format) ? true : getMessage("Invalid Date");



// if we don't have that defined, we can always try guessing


return parseDate(value) !== null ? true : getMessage("Invalid Date");



}


This helped today. Thanks !


Hi Kalai,


Even we are facing this issue.


What change needs to be done to the validator script?


I think this looks identical to the one OOB.