We use self-relations (relations where no join criteria columns are specified) to share the same foundset with multiple forms at runtime.
For example, given a self relation table1_to_table1 and forms formA and formB both based on table1, we share the foundset used by formA using
- Code: Select all
//code executed in the context of formA
forms.formB.controller.loadRecords(table1_to_table1);
In 6.0 this worked fine even when formA did not have any records loaded - in such cases formB was being assigned the same empty foundset as the one in formA.
In 6.1, if formA does not have any records (the foundset it empty), calling the method above results in exception
Error: java.lang.IllegalArgumentException: Cannot find function loadRecords for argument null . Basically, when there are no records in the formA foundset, the relation
table1_to_table1 returns null instead of the same empty foundset which it did in 6.0
I am not sure if this is the designed behavior or a bug. If this is the designed behavior, how can we safely share/assign the same foundset from one form to another even when the foundset is empty? Perhaps, having a new method in the form controllers similar to:
controller.assignFoundset(someFoundset) will be handy and will allow us to share foundsets among forms without the use of self-relations (the self-relations are still needed when using TabPanels and assigning forms at design time).