Support Article

Error "Invalid Datetime Format" during property-set

SA-29759

Summary



An activity  has a property-set step to assign the value from service response to the clipboard property.

The example of date received is '4/20/2016 11:37:00 PM'. This value is assigned to a Datetime property.

While running the activity an error message "Invalid datetime Format/invalid Datetime "4/20/2016 11:37:00 PM"' is thrown.

Error Messages



Invalid datetime Format/invalid Datetime "4/20/2016 11:37:00 PM"


Steps to Reproduce

  1. Run application portal.
  2. Select Insurance Type.


Root Cause



User has a DateTime value in the following format: 'mm/dd/yy hour:min:second'. It is not supported. 
The supported format is 'mm/dd/yy hour:min'. (without second)

In PRPC 6.2 SP2 application, function, 'getDateTimeFromString', was invoked to convert to the correct format. 
@(functionLiabrary).getDateTimeFromString(.RequestDt, "MM/dd/yyyy hh:mm:ss a", false). 

In Pega 7.1.7, the same should be applied. 

Resolution



Perform the following local-change: 

The following conversion is added for the property-set step of activity getallcustomers for DummyPage.requestDate:
@(functionLiabrary).getDateTimeFromString(.RequestDt, "MM/dd/yyyy hh:mm:ss a", false). 
 

 

Published October 28, 2016 - Updated November 8, 2016

Have a question? Get answers now.

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