# Find mode and fields enabling

**URL:** <https://forum.servoy.com/t/find-mode-and-fields-enabling/15928>\
**Category:** Classic Servoy\
**Created:** [May 11, 2012, 2:43pm UTC](https://forum.servoy.com/t/find-mode-and-fields-enabling/15928 "2012-05-11T14:43:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![studiomiazzo](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@studiomiazzo](https://forum.servoy.com/u/studiomiazzo)\
**Post date:** [May 11, 2012, 2:43pm UTC](https://forum.servoy.com/t/find-mode-and-fields-enabling/15928/1 "2012-05-11T14:43:32Z")

</div>

Hello,

I’m struggling to find a way to solve quite a tricky problem. Basically, I need to filter a form’s foundset based on a date field: I want to exclude all those records which have this field lesser than today.  
Now, first I tried with relations, but you can only use globals on the left side of the relation, so I could say something like ‘today is null or greater than or equal to date\_field’, but I couldn’t find a way to say that I wanted the _date\_field_ to be null too (which can very well be the case). Then I moved on to filters, but I soon discovered that related foundsets cannot be filtered (yeah!).  
The third and last option was to use find mode and search directly on the foundset of interest. It works, but the problem is that it messes up all the form’s edit/enabling thing. When I perform the find, date fields get enabled (but not editable), and stays like so even after the search is done.

Do you have any suggestion as to how to solve this mess? I’m really starting to feel depressed ![:(]( "Sad")

---

<div class="post-metadata">

**Author:** ![john.allen](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@john.allen](https://forum.servoy.com/u/john.allen)\
**Post date:** [May 11, 2012, 10:52pm UTC](https://forum.servoy.com/t/find-mode-and-fields-enabling/15928/2 "2012-05-11T22:52:17Z")

</div>

You haven’t really explained the issue with enabling/editing (i.e. what you have going into the find and what you want after the search, how many fields, etc.) but there should be no reason you can’t alter those values (edit,enable) at any time programmatically: elements.your\_field.editable = true/false and elements.your\_field.enabled = true/false

---

<div class="post-metadata">

**Author:** ![studiomiazzo](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@studiomiazzo](https://forum.servoy.com/u/studiomiazzo)\
**Post date:** [May 12, 2012, 12:39pm UTC](https://forum.servoy.com/t/find-mode-and-fields-enabling/15928/3 "2012-05-12T12:39:40Z")

</div>

Maybe I didn’t explaint too well, I’d like to:

- filter the foundset by performing a find on it, _without_ entering data into the form (I’m doing the search programmatically)
- keep all the form in browse mode (no button enabled whatsoever)

The fact is the find seems to enable (still not editable, but enabled) some fields, namely those which are defined of type calendar, which get the little button on the right to choose a date from the javascript calendar enabled.  
I’m basically using the find as an alternative to relations/foundset filters, which don’t apply to my situation (for the reasons explained before).

---

<div class="post-metadata">

**Author:** ![studiomiazzo](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@studiomiazzo](https://forum.servoy.com/u/studiomiazzo)\
**Post date:** [May 16, 2012, 10:17am UTC](https://forum.servoy.com/t/find-mode-and-fields-enabling/15928/4 "2012-05-16T10:17:45Z")

</div>

anyone on this?

---

<div class="post-metadata">

**Author:** ![jbrancoIF](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@jbrancoIF](https://forum.servoy.com/u/jbrancoIF)\
**Post date:** [May 16, 2012, 1:15pm UTC](https://forum.servoy.com/t/find-mode-and-fields-enabling/15928/5 "2012-05-16T13:15:13Z")

</div>

I’d try to do the find in a separate/duplicate foundset and after load it on the form.

---

<div class="post-metadata">

**Author:** ![studiomiazzo](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@studiomiazzo](https://forum.servoy.com/u/studiomiazzo)\
**Post date:** [May 16, 2012, 6:01pm UTC](https://forum.servoy.com/t/find-mode-and-fields-enabling/15928/6 "2012-05-16T18:01:07Z")

</div>

> jbrancoIF:  
> I’d try to do the find in a separate/duplicate foundset and after load it on the form.

That seems quite reasonable indeed ![:D]( "Very Happy") Thanks!
