returning getSize() of a relation issue.

Hi All,

In a calculation I am using the following statement “tbl1_to_tbl2.getSize()” . But when the size of the relation is greater than 60 , it is not displaying . How we can access the total size of the relation inside the calculation ?

Thanks in advance . Waiting for your feedback.

You should use databaseManager.getFoundsetCount() or run your own query but that’s not a nice thing to do in a calculation. Calculations can be triggered quite often and could be very hravy on performance if you use one of the above. Can’t you work around it somehow?

Hi ngervasi,

Thanks for your reply . So what I should be doing in this situation ? . I have the only option to show it in the calculation. I am in a great difficulty in this situation.

Thanks in advance . Waiting for your feedback.

HI,

Do you really need it in a calculation ?
You could simply use an in-memory column that you then fill (when needed) with a method.
It’s almost like a calc but instead of Servoy triggering the code for it you are the one controlling the method.

You create a in-memory (lets say virtual) column by creating a unstored calculation with the following code:

return;

Now you have an unstored calculation where you can set the value like a normal column.
Now with a method you can start filling this with the values you need like on an onShow or onRecordselect event.

Hope this helps.