loadRecords() foundset/controller difference?

Hi all,

I’ve been playing around with (related)foundsets and ran into an interesting difference between controller.loadRecords() and foundset loadRecords();

Consider the form Orderdetails containing a related foundset ‘order_to_orderdetails’;
I’d like to have this same form containing an unrelated version of this foundset.

Basically I thought this would do the job:

var _unrelate = forms.Orderdetails.foundset.unrelate();
forms.Orderdetails.foundset.loadRecords(_unrelate);

but it doesn’t, this will do the job:

var _unrelate = forms.Orderdetails.foundset.unrelate();
forms.Orderdetails.controller.loadRecords(_unrelate);

Is this having something to do with the fact you also can’t call foundset.clear() on a related foundset or what’s really the point here?

Any input is appreciated, thnkx!

you cant do the first because what you are trying to do is loadrecord(fs) in a Relatedfoundset…
Thats not allowed, a related foundset can’t be changed like that. Because if you would do that then the related instance (where you call unrelate() on) would also be changed!

In this situation you really have to replace the foundset itself (controller.loadRecords()) instead of replacing the contents of the foundset…