14 views

Description

In the Service Portal, manually typed invalid dates can be saved incorrectly, such as '02-09-0017', when the variable is set to Mandatory

When using the Service Portal and interacting with service catalog Date variables, there is no check on the date format when the date field is set to Mandatory. When dates are manually typed using a two-digit format for the year (i.e. dd-MM-yy), the dates are saved in an incorrect format (i.e. 02-09-0017). The system is setting the date as dd-MM-yyyy, but the leading zeros come from the year value are being entered as 2-digits instead of four.

Steps to Reproduce

  1. Navigate to System Properties > System and confirm that the 'glide.sys.date_format' property is set to 'yyyy-MM-dd'.
  2. Edit the 'Create incident' Record Producer and add a Date variable 
    https://<instance-name>.service-now.com/sc_cat_item_producer.do?sys_id=3f1dd0320a0a0b99000a53f7604a2ef9
  3. Navigate to Service Portal > Open the catalog item 'Create incident'
    https://<instance-name>.service-now.com/sp?id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9
  4. Manually type the value of the Date field as '17-09-02' and click away from the date field:
    Note the message saying you used the wrong format - you aren't allowed to save the form, which is expected.
  5. Set the variable to Mandatory
  6. Open the Catalog Item again https://<instance-name>.service-now.com/sp?id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9
  7. Manually type the value of the Date field as '17-09-02' and click away from the date field:
  8. Submit the form and look at the saved incident. 

 You do not see the bad-formatting message, and you are allowed to save the bad value, which saves as 0017-09-02. This is wrong.

Workaround

This issue is under review. To receive notifications when more information is available, subscribe to this Known Error article by clicking the Subscribe button at the top right of the article. If you are able to upgrade, review the Fixed In field to determine whether any versions have a permanent fix.


Related Problem: PRB1300937

Seen In

London

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-09-14 08:00:13
Published:2018-09-14