Find() filter = undefined?

Hi everybody,

I’m doing a method which makes a search depending on what the user entered in the fields. To make it easy to explain let assume that there are 4types of records: A, B, C and D

The search works except that it seems to seach on the records of type A and B and never give results with records of type C and D as if there was a constant filter to search only for A and B records.
Even when you don’t enter anything in the filter fields (in that case it should display all the records) it still return only records of type A and B

So, in order to find the problem I have printed the content of the filter fields just before the controller.search() (no parameter so the search should search in all data in the table). Example: ```
application.output("forms.frm_expenses_list.fld_approved_by = "+forms.frm_expenses_list.fld_approved_by);


Results printed look ok: nothing printed. Except for few fields which print "undefined". Example:

forms.frm_expenses_list.fld_submitted =
forms.frm_expenses_list.fld_approved_by = undefined


It doesn't seems to influence the search as records of type A and B are displayed.

There are only 2 fields which, once filtered, could provide the type of result I have at the moment. The 1st one prints nothing and the second one prints "undefined".

Also, to make sure it is this search which is not working properly I do a "controller.getMaxRecordIndex()" which confirms that the search doesn't provide the right number of results.

Hi,

What if you don’t use the empty (and undefined) values in your search? Did you try that yet?

ROCLASI:
What if you don’t use the empty (and undefined) values in your search? Did you try that yet?

Was a good idea!

I’ve hardcoded the filter with a fix value and then printed it and still print “undefined” :shock:

forms.frm_expenses_list.fld_approved_by = 57;
application.output("forms.frm_expenses_list.fld_approved_by = "+forms.frm_expenses_list.fld_approved_by);

forms.frm_expenses_list.fld_approved_by = undefined

:oops:

Ok, forget this story with “undefined”. It was just because the fields name didn’t correspond to the table fields name :oops:
Now all filters are totaly empty.

But I still have this issue with only records of type A and B displayed :|

I really don’t understand. It displays that all the filters are at null but It still display half of the reords :(
Here is the code I use:

if (forms[v_list].controller.find())
		{
			globals.SetFilters(v_form);
			try{
				forms[v_list].controller.search();
				application.output("FilterList() Max Records = "+forms[v_list].controller.getMaxRecordIndex());
			}
			catch (e){}
			....
		}

At the end of SetFilters I print the content of all the fields of the table attached to the form.
As you can see there is no code between the print and the when I display the number of results.

Any suggestion?