Kendo grid with column filtering on a DATE field (not DATETI

Posted by wes.rector on 05-Jul-2018 09:08

We have lots of DATE fields in our tables going way back to before there was a DATETIME type. We've noticed that if we enable Column Filtering on a grid and try to filter on one of those DATE fields we get the good old datatype mismatch error:

** Incompatible data types in expression or assignment. (223)
Failed to auto-prepare an automatic fill query. (11981)

The ablFilter that gets built looks like this:

entry-date = DATETIME(10, 13, 2004, 00, 00, 00, 000)

Of course, entry-date is a DATE field, not DATETIME, so boom goes the dynamite. How can we best change this behavior so that ablFilter gets DATE(10, 13, 2004) instead of DATETIME(10, 13, 2004, 00, 00, 00, 000)?

Posted by egarcia on 05-Jul-2018 14:52

Thank you for the info.

This issue happens because the call to ablType() uses the value for origName to find the field instead of the field name as listed in the schema. The code cannot find the item in the schema and goes through the else clause and uses DATETIME.

Are you seeing this issue with an AngularJS or an Angular project?

A possible workaround is to find the following line in progress.all.js (AngularJS) or progress.core.js (Angular) and change it to use filter.field:

                       ablType = tableRef._getABLType(field);

-->

                       ablType = tableRef._getABLType(filter.field);

Please notice that if it is an AngularJS project, KUIB would restore the original progress.all.js file on code generation.

Could you contact Technical Support and log a bug report for this issue?

Thank you and regards.

All Replies

Posted by egarcia on 05-Jul-2018 14:19

Hello,

This is an interesting case.

How does the field definition looks like in your catalog file?

(Are you serializing the name?)

Here is an example of for the definition of a DOB field in the catalog:

                                   "DOB": {

                                       "type": "string",

                                       "ablType": "DATE",

                                       "default": "2017-08-16",

                                       "title": "Date of Birth",

                                       "format": "date"

                                   },

Code in the JSDO looks at ablType properties and generates the appropriate code in the ablFilter.

Please let check the catalog definition.

I hope this helps.

Posted by wes.rector on 05-Jul-2018 14:28

"entrydate": {

 "type": "string",

 "ablType": "DATE",

 "default": null,

 "title": "Entry Date",

 "format": "date",

 "origName": "entry-date"

}

Posted by egarcia on 05-Jul-2018 14:52

Thank you for the info.

This issue happens because the call to ablType() uses the value for origName to find the field instead of the field name as listed in the schema. The code cannot find the item in the schema and goes through the else clause and uses DATETIME.

Are you seeing this issue with an AngularJS or an Angular project?

A possible workaround is to find the following line in progress.all.js (AngularJS) or progress.core.js (Angular) and change it to use filter.field:

                       ablType = tableRef._getABLType(field);

-->

                       ablType = tableRef._getABLType(filter.field);

Please notice that if it is an AngularJS project, KUIB would restore the original progress.all.js file on code generation.

Could you contact Technical Support and log a bug report for this issue?

Thank you and regards.

Posted by wes.rector on 05-Jul-2018 15:01

It's an AngularJS project. I'll give that a try, and we'll log the issue with Technical Support. Thanks!

This thread is closed