I have used Data page to show the cases in the user work queue. In data page , I have used report definition as a source to fetch the results. But I am not able to see any results in user work queue because of the below error.
In where clause of the report definition, I have used date property in left hand side and used the Pega provided date option “Today” in the right hand side with relationship as less than.
Ex: TestDate < Today
When I try to run the RD with above condition, following exception is getting triggered and same has been captured in logs as well.
Error:
An error occured on executing the query for the report definition - Database column in database pegadata, table has an unknown type: JDBC Type: Date
Displaying 0 records
Based on the observation, Function “Today” has been considered as datetime whereas not date. Tried the below the approach but it didn’t worked.
Tried to pass current date as parameter.
Tried to pass a page which contains current date property.
Kindly share your suggestion to resolve the issue.
Please note that my requirement is not to show cases based on creation date. “Test Date” which I have mentioned is a clipboard property specific to Work object.
Also I passed the current date as param to right side of the where clause not to the left side. As “Today” is considered as datetime.
Left Side - TestDate → Date property
Right side - Today → Pega provided
TestDate < Today → 06/01/2023 < 06/06/2023
Functions provided in the where clause are related only to Datetime whereas not to date. Also it is not accepting the customized function in the right side . Only populated functions can be used.
Please suggest how to compare 2 dates ( only date) in the where clause of the report definition.
Hi @Seetharaman, your observation is correct you cannot directly compare the date property with “Today” or any other OOTB values because they work only for date time properties. Also, I don’t think there’s an OOTB function which does the conversion of date to date time within the RD itself.
The only possible solution that I could imagine was to have a new exposed property, let’s say CurrentDate, it will be linked to a declare expression which in return will calculate current date using the @CurrentDate() function and this property can be then used on the right hand side of your RD’s condition.
@Seetharaman you can use Data Page with Data transform.
In Data transform set the currentdate to date property. and refer the Data page in Filter right side value as “Datapage.DatePropertyName”. Make sure in pages and classes define the data page
Yes I tried this approach. If we run the Rd standalone with above approach its working fine. But during run time again we are getting the same error message.