Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Error when Pega reads data from Integration layer to App layer

SA-103062

Summary



User has received the DateTime (YYYY-MM-dd hh:mm:ss.sss) format from an external system and has stored the values in a DateTime property type in the Integration layer.
Error occurs when the application reads the data from the Integration layer to the Application layer for manipulation such as, extracting only the Date through the sub string. The Validation error occurs post upgrade to Pega Platform 8.3.1.



Error Messages



2019-07-10 00:00:00.000 is not a valid date/time value


Steps to Reproduce



Not Applicable


Root Cause



The error occurred when the below steps are used in the DataTransform,
  1. Set DateTime property with the value as, testdate  property (Value:2008-02-07 13:45:51.646)
  2. Use the @String.whatComesBeforeFirst(testdate,' ') DateTime property  
The output is as below:

<pagedata>

<DT>2008-02-07 13:45:51.646</DT>

<pxObjClass>GCS-SRS-Work</pxObjClass>

<LastNoteDateTime>2008-02-07 13:45:51.646</LastNoteDateTime>

<pzStatus>false</pzStatus>

<PZ__ERROR DATAFLD="DT">

2008-02-07 13:45:51.646 is not a valid date/time value

</PZ__ERROR>

<PZ__ERROR DATAFLD="LastNoteDateTime">

2008-02-07 13:45:51.646 is not a valid date/time value

</PZ__ERROR>

</pagedata>


Resolution



Perform the following local-change:

Modify the value to DateTime property (property name: DT) as below:

Set .DT to "20130806T061841.958 GMT"
When @String.whatComesBeforeFirst(.DT,'T')!=""
Set .LastNoteDateTime to @String.whatComesBeforeFirst(.DT,'T')




The error occurs because the Date does not have a format.

The below code is used in the DataTransform step:

When @String.whatComesBeforeFirst(D_ODMPartyInformation[Param.BBBId].partyCreationDate,' ') != ""
Set Param.partyCreationDateOperator = @String.whatComesBeforeFirst(.partyCreationDate,' ')

If the Date property has the java.util.Date type, which is a binary representation of a Time/Date value without a time zone, the property can be translated to a String (if the correct function is used with the correct arguments). This String may have the 'yyyy-MM-dd' format as defined by ISO 8601. However, providing that String (of java.lang.String type) to a function that takes an argument of java.util.Date type causes the exception. This is because, the java.lang.String is not a java.util.Date irrespective of the content that the String has and if it is interpreted as a Time/Date value or not.

As a local-change, store the DateTime value in GMT format such that, the Pega application automatically converts the value to the local time zone before display.

For more information, refer to: https://community1.pega.com/support-articles/invalid-datetime-format-displays-valid-datetime-property
Suggest Edit

Published July 16, 2020 - Updated December 2, 2021

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us