# Omit All

**URL:** <https://forum.servoy.com/t/omit-all/1851>\
**Category:** Classic Servoy\
**Created:** [May 5, 2004, 8:31pm UTC](https://forum.servoy.com/t/omit-all/1851 "2004-05-05T20:31:17Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![r.rios](https://avatars.discourse-cdn.com/v4/letter/r/c4cdca/32.png) [@r.rios](https://forum.servoy.com/u/r.rios)\
**Post date:** [May 5, 2004, 8:31pm UTC](https://forum.servoy.com/t/omit-all/1851/1 "2004-05-05T20:31:17Z")

</div>

What would be the least expensive way to show a form with an empty foundset?

I tried:

```auto
controller.loadRecords(null);

```

but this loaded a separate foundset on the form then the other forms of the same table.

And I think

```auto
controller.loadAllRecords();
controller.invertRecords();

```

and

```auto
controller.loadAllRecords();
controller.loadOmittedRecords();

```

could be very expensive.

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [May 6, 2004, 5:15pm UTC](https://forum.servoy.com/t/omit-all/1851/2 "2004-05-06T17:15:15Z")

</div>

when nothing is omitted

```auto
controller.loadOmittedRecords();

```

is the fastest and cheapest way to get an empty foundset.

---

<div class="post-metadata">

**Author:** ![r.rios](https://avatars.discourse-cdn.com/v4/letter/r/c4cdca/32.png) [@r.rios](https://forum.servoy.com/u/r.rios)\
**Post date:** [May 6, 2004, 5:42pm UTC](https://forum.servoy.com/t/omit-all/1851/3 "2004-05-06T17:42:32Z")

</div>

Jan,  
what if there are omitted records?

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [May 6, 2004, 6:14pm UTC](https://forum.servoy.com/t/omit-all/1851/4 "2004-05-06T18:14:00Z")

</div>

They will be shown ![:)]( "Smile"), what you actually want is an explicit way to clear a foundset? like controller.clearFoundSet() ?  
Why whould you need this?

---

<div class="post-metadata">

**Author:** ![r.rios](https://avatars.discourse-cdn.com/v4/letter/r/c4cdca/32.png) [@r.rios](https://forum.servoy.com/u/r.rios)\
**Post date:** [May 6, 2004, 6:37pm UTC](https://forum.servoy.com/t/omit-all/1851/5 "2004-05-06T18:37:14Z")

</div>

controller.clearFoundSet() ? uhm, that sounds good ![:D]( "Very Happy")

The reason is that I want the users to find an empty foundset every time they enter this form from the main menu, it would be even better if I could call a controller.show() without having Servoy request all of the records.

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [May 6, 2004, 6:48pm UTC](https://forum.servoy.com/t/omit-all/1851/6 "2004-05-06T18:48:21Z")

</div>

workaround for now:

make a method and attach on the onShow property of a form:

```auto
controller.find()
field1 = "abracadabraabracadabraacradabra"
controller.search()
if(controller.getMaxRecordIndex() > 0)
{
plugins.dialogs.showInfoDialog('WOW!', 'You are a hell of a lucky guy that you have typed this into your field! You have won the deepfreezer!! ','OK');
}
else
{
//you have an empty foundset!
}

```

![:lol:]( "Laughing") ![:lol:]( "Laughing")

---

<div class="post-metadata">

**Author:** ![r.rios](https://avatars.discourse-cdn.com/v4/letter/r/c4cdca/32.png) [@r.rios](https://forum.servoy.com/u/r.rios)\
**Post date:** [May 6, 2004, 7:06pm UTC](https://forum.servoy.com/t/omit-all/1851/7 "2004-05-06T19:06:20Z")

</div>

Thanks HJK,  
that’s quite a colorful way of explaining it ![:D]( "Very Happy")

This is what I’ve been doing, a find/search that I know will not return any records, but I feel there should be a more elegant and less expensive way.

 ![mod_dialog_113_pbm.png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/c/c8afbad068e2729273b32af14b4273d8bc5bf2a8.png)

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [May 6, 2004, 7:22pm UTC](https://forum.servoy.com/t/omit-all/1851/8 "2004-05-06T19:22:36Z")

</div>

> r.rios:  
> The reason is that I want the users to find an empty foundset every time they enter this form from the main menu, it would be even better if I could call a controller.show() without having Servoy request all of the records.

Attach an empty method to onLoadAllRecordsCmd property to leave it empty by default.

---

<div class="post-metadata">

**Author:** ![r.rios](https://avatars.discourse-cdn.com/v4/letter/r/c4cdca/32.png) [@r.rios](https://forum.servoy.com/u/r.rios)\
**Post date:** [May 6, 2004, 8:01pm UTC](https://forum.servoy.com/t/omit-all/1851/9 "2004-05-06T20:01:02Z")

</div>

onLoadAllRecordsCmd? is this a form property?

or did you mean onShowAllRecordsCmd? this didn’t work either.

 ![ErrorCallingServer2.png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/4/4d56cf658945795929d55bf54d183d1736b0d14c.png)

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [May 6, 2004, 8:10pm UTC](https://forum.servoy.com/t/omit-all/1851/10 "2004-05-06T20:10:48Z")

</div>

yes, onShowAllRecordsCmd add empty method prevents records being loaded by default. (just tested this again)

 ![FirstDlgOKbtn.png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/e/e0f7afe62d36dbe143fe930b60f5a0b8ba9700e6.png)

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [May 9, 2004, 6:32pm UTC](https://forum.servoy.com/t/omit-all/1851/11 "2004-05-09T18:32:31Z")

</div>

do you really want the form to be empty every time a user goes to the form? Or just the first time it enters that form?

The first time works if you override the onShowAllRecordsCmd  
But then you also must say that you want to use a separate foundset because if you don’t then if you have other forms that builds on that table and those forms are shown first you will see that data.

if you always want a empty foundset when the users shows the form then you have to this, make this method:

if(controller.getMaxRecordIndex() == 0)  
{  
emptyFoundset = controller.duplicateFoundSet();  
}  
else  
{  
controller.loadRecords(emptyFoundset)  
}

and attach that method to the onShow and onShowAllRecordsCmd

---

<div class="post-metadata">

**Author:** ![r.rios](https://avatars.discourse-cdn.com/v4/letter/r/c4cdca/32.png) [@r.rios](https://forum.servoy.com/u/r.rios)\
**Post date:** [May 9, 2004, 7:00pm UTC](https://forum.servoy.com/t/omit-all/1851/12 "2004-05-09T19:00:52Z")

</div>

> jcompagner:  
> do you really want the form to be empty every time a user goes to the form? Or just the first time it enters that form?

Every time a user enters the form from the main menu (specific form).

> jcompagner:  
> But then you also must say that you want to use a separate foundset …

actually, I don’t. If I did then controller.loadRecords(null); would have been just fine and I believe is equivalent to your example below, but it creates a separate foundset for this form and I don’t want that.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [May 9, 2004, 7:31pm UTC](https://forum.servoy.com/t/omit-all/1851/13 "2004-05-09T19:31:02Z")

</div>

OK then then the only solution is to have a clearFoundSet method..  
That will make the shared foundset empty over all the forms that are build on that table.

---

<div class="post-metadata">

**Author:** ![r.rios](https://avatars.discourse-cdn.com/v4/letter/r/c4cdca/32.png) [@r.rios](https://forum.servoy.com/u/r.rios)\
**Post date:** [May 10, 2004, 12:17pm UTC](https://forum.servoy.com/t/omit-all/1851/14 "2004-05-10T12:17:44Z")

</div>

Thanx a lot ![:D]( "Very Happy")

Will this be in 2.0.1?

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [May 11, 2004, 12:24pm UTC](https://forum.servoy.com/t/omit-all/1851/15 "2004-05-11T12:24:33Z")

</div>

foundset.clearFoundSet() or orders\_to\_order\_details.clearFoundSet() will be possible in Servoy 2.1 (the I18N release)

 ![screens.png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/6/61842f6b2ef70dee2bc7bc4857c1d7ecfc6f5705.png)

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [May 11, 2004, 12:33pm UTC](https://forum.servoy.com/t/omit-all/1851/16 "2004-05-11T12:33:14Z")

</div>

> (the I18N release)

What’s that?

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [May 11, 2004, 1:04pm UTC](https://forum.servoy.com/t/omit-all/1851/17 "2004-05-11T13:04:14Z")

</div>

i18n (internationalization)
