Related sorting in 3.5 with globals

Hello,

I have a relation that points from

globals.i18n_locale
i18n_key

to the messages table. The i18n_key is stored in the table and the locale is a global. I have a calculation that shows the message_value for the current locale. Now I wanted to sort the table with the new possibilities in 3.5’s table views. I catch the calc field and try to sort over the relation as for example

if (vSortField == 'myCalc') {
   controller.sort('table_to_messages.message_value ASC')
}

When I do that I get

757294 [AWT-EventQueue-0] ERROR com.servoy.j2db.util.Debug  - Throwable
java.lang.ClassCastException: com.servoy.j2db.persistence.ScriptCalculation cannot be cast to com.servoy.j2db.persistence.Column
        at com.servoy.j2db.dataprocessing.t.a(Unknown Source)
        at com.servoy.j2db.dataprocessing.t.a(Unknown Source)
        at com.servoy.j2db.dataprocessing.t.a(Unknown Source)
        at com.servoy.j2db.dataprocessing.FoundSet.sort(Unknown Source)
        at com.servoy.j2db.FormController.if(Unknown Source)
        at com.servoy.j2db.FormController.sort(Unknown Source)
        at com.servoy.j2db.FormController$JSForm.js_sort(Unknown Source)
        at inv9.invoke()
        at org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:550)
        at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:466)
        at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1254)
        at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2031)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
        at com.servoy.j2db.scripting.e.call(Unknown Source)
        at com.servoy.j2db.develop.debugger.k.a(Unknown Source)
        at com.servoy.j2db.develop.debugger.k.access$100(Unknown Source)
        at com.servoy.j2db.develop.debugger.k$2.run(Unknown Source)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

i18n_key is a stored calc. I have changed the name of that calc to make sure the error is not because of that (and it isn’t), so I suppose it’s the global. From a SQL point of view, that should be possible. Can this be looked at?

Thanks
Patrick

please file a support case with small sample solution in our support system

I have done so (case #91162). I have found out that the problem is not related to globals, but to calcs. No matter if these are stored or not. Sample solution included. I guess I should have restarted after renaming the calc, because in my first tests renaming the calc did not heal the issue.

This issue is fixed in release 3.5.1

Rob

excellent!