# breaking related foundset

**URL:** <https://forum.servoy.com/t/breaking-related-foundset/4840>\
**Category:** Classic Servoy\
**Created:** [October 6, 2005, 12:11pm UTC](https://forum.servoy.com/t/breaking-related-foundset/4840 "2005-10-06T12:11:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [October 6, 2005, 12:11pm UTC](https://forum.servoy.com/t/breaking-related-foundset/4840/1 "2005-10-06T12:11:50Z")

</div>

Hi,

I have a master form with a detail form in a related tab panel.

I want to search within the related form independent of related records.  
ie I want to search within the full foundset.  
But this did not work and it finds records within the related foundset.

So I used controller.loadAllRecords() in the related form before the find.  
It worked for 1st time & not the 2nd then it worked for the 3rd and not the 4th and so on..  
So I used controller.loadAllRecords() twice as

controller.loadAllRecords();  
controller.loadAllRecords();

and it worked.

Is this a bug?

Please help!

```auto
//*** set the confirmed_quote_id to the current quote_id for manual history records
frmObjQuoteProductManual.controller.loadAllRecords(); //*** to break the related fs within tabpanel
frmObjQuoteProductManual.controller.loadAllRecords(); //*** only breaks if used twice. so this line.
frmObjQuoteProductManual.controller.find();
frmObjQuoteProductManual.quote_id = frmObj.quote_id;
frmObjQuoteProductManual.controller.search();
var fsUpdater = databaseManager.getFoundSetUpdater(frmObjQuoteProductManual.foundset);
fsUpdater.setColumn("confirmed_quote_id", frmObj.quote_id);
fsUpdater.performUpdate();

```

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [October 6, 2005, 2:55pm UTC](https://forum.servoy.com/t/breaking-related-foundset/4840/2 "2005-10-06T14:55:53Z")

</div>

Is the master to detail form a normal parent child relation?(not a selfjoin?)  
The foundset of the related tab panel is always limited by the relation,  
so it seems a bit weird to do a “forced” find over the complete child table.

if you want that behaviour, I would make the tabpanel relationless and let the foundset be determined by a script (eg. fired onRecordSelect of parent record) This will leave you with freedom to do anything with the “child” foundset.

---

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [October 10, 2005, 7:49am UTC](https://forum.servoy.com/t/breaking-related-foundset/4840/3 "2005-10-10T07:49:04Z")

</div>

The master to detail form is a normal parent child relation only and not a self join.

Are you saying that if we use a form in a related tabpanel then I could not use it for normal full table search.

Also are you saying that if I use childForm.loadAllRecords() it will not load all the records in the full table? and If I use childForm.loadAllRecords() twice it will load all records in the table?

I think it is logical that if I want to a do a search on the childForm it should search the whole table. For example if I want to search childForm for records from two parent records, do I need to create another childForm2 using the same table? I think it is not necessary.

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [October 10, 2005, 2:45pm UTC](https://forum.servoy.com/t/breaking-related-foundset/4840/4 "2005-10-10T14:45:46Z")

</div>

> I think it is logical that if I want to a do a search on the childForm it should search the whole table.

Not if you are showing the child form through a tabpanel that’s located on the parent form. I would only expect RELATED records there.

If you are re using the Child form in an independent setting (read: as a main form) then the foundset can be anything you want because there’s no “parent record” context.
