same table, different foundsets for different sets of forms

I have a table called contact.
I have two sets of forms and all the forms are using the table contact.

set1:

contact$list
contact$detail

set2:

relation$list
relation$detail

What I want here is to have two different foundsets each for each above sets of forms.

How can I accomplish this?

Thanks!

Check the useSeperateFoundset checkbox in the form properties.
It does what the name implies ;)

I have tried using useSeperateFoundset but it does not help my case.

I want contact$list & contact$detail to share the foundset 1 and relation$list & relation$detail to share the foundset 2.

If I check useSeperateFoundset for relation$list & relation$detail forms then we get 3 different foundsets. one for contact$list & contact$detail another for relation$list and another for relation$detail

Any idea please?

Hi Hameed,

You can either use the shared foundset or the seperate foundset.
When you use a seperate foundset it’s up to you to keep forms in sync with the foundset of your choosing.
With controller.loadRecords(myOtherFoundset) you keep them in sync.

Hope this helps.

Hi Robert,

Thanks for explanation. If it would be possible to use foundset groups that would have been very handy (less coding).

My question is if I use controller.loadRecords(myOtherFoundset), when I move the cursor pointer from one record to another record in my form1, will it automatically move the cursor in the form2 as well? (both form1 & form2 share same foundset using the above loadRecords method)

I just tested it (in 2.2.7). And the answer is no.
Once you are not using shared foundsets you have the control.
Or to say it differently, you then need to control everything.

But your record browsing example can easily be ‘fixed’ with a onRecordSelection event.

Thanks for your help on this.

In the onRecordSelection of the form1 if I set the recordIndex of the form2 I hope it would not again trigger the onRecordSelection of the form2 or will it?

Regards,
Hameed

It will trigger the onRecordSelection.
If you use the onRecordSelection event on both forms you might want to check if form1 has already the same selectedindex as form2 before setting it, and vice versa.

Hope this helps.

Great tip! Thanks a lot.

I will try to implement.

Thanks!

Hi there,

What is the performance hit if I load a foundset in to say 10 similar forms?

Thanks!

If it’s the same foundset the performance hit will be very little in comparison when you have 10 different foundsets (i.e. 10 different queries).

Hope this helps.

appreciated your reply!

implemented the method and it works perfectly!!

Thanks!