Date fields not allowing entry to save due to incorrect format
search cancel

Date fields not allowing entry to save due to incorrect format

book

Article ID: 239516

calendar_today

Updated On:

Products

CA IT Asset Manager Asset Portfolio Management CA IT Asset Manager ASSET PORTFOLIO MGMT- SERVER

Issue/Introduction

When saving a record on ITAM, an error appears:

-> "You entered the Expiration Date value in an incorrect format".

The browsers, Chrome and IE11 tested, are set as English UK and due to that the format is dd/mm/yyyy.
The same happens with the browser set as English US (mm/dd/yyyy).

Above is happening with SDM originating date fields that are being added as ITAM Extended fields 

Environment

Release : 17.3

Component : ITAM - Administration

Resolution

Consider two possible fields, one which is an OOTB nr_exp_dt (Expiration Date) that is defined in SDM and a custom SDM field z_date1 (Notification Date)

1) If you create an extension for an SDM date field as Format "Integer", you will need only to execute these statements:

UPDATE arg_field_def 
SET data_type = 99 
WHERE table_name like '%usp_owned_resource%' AND field_name like 'z_end_date'

UPDATE al_form_attribute_def 
SET control_type_id=10 
WHERE class_name like 'usp_owned_resource' AND attribute_name like 'nr_exp_dt'

UPDATE al_link_attribute_config 
SET regexp = '' 
WHERE class_name like 'usp_owned_resource' AND attribute_name like 'nr_exp_dt'

This last statement will remove the regular expression that prevents a date to be saved when the field was created as integer.

2) if you create an extension for an SDM date field as Format "Date" you will need only to execute this statement:

UPDATE al_form_attribute_def 
SET control_type_id=10 
WHERE class_name like 'usp_owned_resource' AND attribute_name like 'nr_exp_dt'

Here seems that the system already does part of the work when setting the Format as "Date"

After these statements, both errors, the error message and the problem with managed search date picker, should be addressed.

Additional Information

As with any changes to the backend database, please perform a backup of the database prior to attempting any changes.  We also recommend testing the changes in a non-prod instance before attempting the change in production.