Calculations referencing form methods

Hi Servoy,

In some calculations we have references to form methods (leftover from the time when there were no scopes and only “globals”. These “forms” are really used as “containers” to separate the code into different files instead of having enormous globals.js)

Now we discover in the server logs errors similar to:

Exception executing calculation: calcf_price of table im_sku, error: org.mozilla.javascript.EcmaError: TypeError: Cannot find function getRecForSpecificDate in object

It appears that when calculations are evaluated, any forms referenced as: “forms.some_form_name…” are not being loaded (using “scopes.some_scope_name…” however works fine)

Looking at the available documentation in the Servoy Wiki about calculations I cannot find any reference to restrictions on using form methods in calculations. Also, I have not seen these errors before (we use Servoy 7.4)

My question is: Can form methods be used in calculations or not? If yes, why do we get the errors above “……”? If no, why there is no “warning” about this in the documentation similar for example to the warning about the performance? (see: https://wiki.servoy.com/display/public/ … lculations)

We are trying to figure out if we need to change our code OR if we need to create a bug case. Any input will be most welcome.

As far as I know, from the beginning of Servoy it was never recommended to use form stuff, in calculations, so we always avoided it.

Here is an (very-old) topic, in which Johan explains: viewtopic.php?f=3&t=2768&hilit=calculation+touch+form