Find mode and fields enabling

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 :(

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

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).

anyone on this?

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

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 Thanks!