Datagrid 2s Dynamic row class leads to evaluation error in browser

0
I'm using DataGrid 2 with the following dynamic row class expression:   if $currentObject/Expiration_Date <= [%CurrentDateTime%] then 'red-text' else ''   Expiration_Date is a date attribute, so Mendix Studio Pro accepts this as a valid expression.   When i run this on localhost, no errors are thrown in the browser console.  It's only when I deploy remotely do I invoke the following error in a browser console:   [Client] Error: An error occurred while evaluating value of EIRF.Release_Requests.dataGrid21: Operator < not supported in expression <(, Fri Mar 21 2025 14:36:36 GMT-0600 (Mountain Daylight Time))    at l (mxui.js?638780145843523330:66:210956)    at mxui.js?638780145843523330:66:210561    at mxui.js?638780145843523330:66:324772    at se (mxui.js?638780145843523330:24:5539)    at e.computeValue (mxui.js?638780145843523330:24:11808)    at e.trackAndCompute (mxui.js?638780145843523330:24:11634)    at e.get (mxui.js?638780145843523330:24:10692)    at mxui.js?638780145843523330:66:324869    at se (mxui.js?638780145843523330:24:5539)    at e.computeValue (mxui.js?638780145843523330:24:11808)   I'm assuming it has something to do with differences in how CurrentDateTime is evaluated based on whether it's running on a localhost or a server.  That or the '=' operator somehow got turned into '(,' after deployment.  How should I revise the expression?
asked
2 answers
1

Hey Tyler, this looks frustrating dude. I hate these kinds of errors.

One thing you could try and do to debug is temporarily create an attribute in whatever entity the Expiration_Date attribute is located in and set the value of the new attribute to the current date time. After that change, change your expression to reference the new attribute and see if it gives you the same error. I think you may be on to something with your hunch, but I've never experienced something like this before.

 

Good luck!

answered
1

Check the access rights on Expiration_Date and add a != empty check in the expression

answered