Calculations referencing form methods

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

Calculations referencing form methods

Postby rossent » Fri May 16, 2014 4:23 pm

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 <Form biz__argos_user_data__im_price_code_date not loaded yet>


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 "...<Form some_form_name not loaded yet>..."? 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)
Rossen Totev
Argos Software
rossent
 
Posts: 288
Joined: Wed Dec 31, 2008 2:03 pm

Re: Calculations referencing form methods

Postby rossent » Mon May 19, 2014 2:55 pm

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.
Rossen Totev
Argos Software
rossent
 
Posts: 288
Joined: Wed Dec 31, 2008 2:03 pm

Re: Calculations referencing form methods

Postby Harjo » Mon May 19, 2014 4:12 pm

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
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 12 guests

cron