Question

Property-Set Date Time Error

I am attempting to use property-set for a DateTime value from XML.

The value comes from the XML and appears on clipboard correctly.

(ex. 2015-04-19 05:00:00).

However, when I attempt property-set PEGA does not like it.

The following error is given:

Invalid expression or reference: For literal Date/Time/DateTime values, enclose the value in double quotes; for property reference, prefix the expression with an equals sign

Also see attachment for screen shots.

Correct Answer
February 26, 2018 - 7:49pm

HI,

Please check OOTB DateTime property usage for "property-set" method in activity. 

For example. open "pxCreateDatetime" which is a DateTime property. You can do "View references" and find out how it is used in activity "property-set" method. 

Also, please check below pdn link:

https://pdn.pega.com/sites/pdn.pega.com/files/help_v72/procomhelpmain.htm#designer%20studio/expressionbuilder/ref_constants.htm

 

Thanks,

Susan

 

Comments

Keep up to date on this post and subscribe to comments

Pega
February 26, 2018 - 7:49pm

HI,

Please check OOTB DateTime property usage for "property-set" method in activity. 

For example. open "pxCreateDatetime" which is a DateTime property. You can do "View references" and find out how it is used in activity "property-set" method. 

Also, please check below pdn link:

https://pdn.pega.com/sites/pdn.pega.com/files/help_v72/procomhelpmain.htm#designer%20studio/expressionbuilder/ref_constants.htm

 

Thanks,

Susan

 

February 26, 2018 - 8:06pm

Can you try setting the property in "yyyyMMddtHHmmss.SSS zzz" format and run the use case. This way we may get clarity if it is really a format issue.

Also, what is the data type for DBSave.HR at your end?

February 27, 2018 - 8:49am
Response to Rachit_Agarwal

.HR in DBSave.HR is a data type of datetime

February 28, 2018 - 9:45pm
Response to HenryA80

Can you try writing a java step where you can convert this input string to date and save it in a local date/datetime parameter?

In the later step, you can assign it to DBSave. 

Please refer to below article. 

https://stackoverflow.com/questions/16910344/how-to-convert-string-into-date-time-format-in-java

Hope this helps.

March 13, 2018 - 10:38am
Response to Rachit_Agarwal

I will give this a try...

January 17, 2019 - 3:12am

Quick fix for THis : Not recomended but it will work. 

Set a Param.A (String type)

Set the Source to Param.A

Set Param.A to Date Time Property. Viola . it will work . 

Not recomended .