I have a contact file. In the Record_View layout it displays a tab panel together with some other local fields (first_name, last_name etc). The tab panel which shows all the record from the contact file itself using a self g_Relation = Relation in a list view.
where g_Relation is a global field which is set to the value “1”
and Relation is a text field with auto enter value “1”
The contact file has a relation “Relation1” to another table.
I have a combobox displayed in the Record View layout.
In its OnDataChange event I am calling a global script which does the following:
it gets the value from the combobox in a variable var1.
it searches a related field of the relation “Relation1” with the value of var1.
Instead of reducing the foundset it just shows all the record (the returned record count is 200 always)
Both are not of same type. The database field is integer type and the combobox field is golbal text field. Now i did a parseInt on the global text field. but no luck yet. Still getting same problem.
Maybe you should check for the relationship between the form with the tabpanel on it to that of the form in the tabpanel. Make that the same relationship and check what happens.
I have checked the relationships and they are fine. If the search is done using a relational field in another form which is not linked in a tab panel, then the search works.
I am attaching you a sample soltion with self related tab panel which has the same searching problem with relations.
Please click the search button in the list form and see the search returns all the available records.
If you use a local field for the search it performs properly. Please check the scripts.
Please let me know if it is a bug or am I missing something.
Also I have another question with search() function.
I have 2 forms FormA and FormB. Both of them linked to the same table. It seems to me that if I do a search in FormA the foundset will be retained in FormB too. But if FormB is linked in a tab panel in another form FormC, then doing search in FormA will not affect the foundset FormB. Is my thinking correct?
It is logical that it finds all records, you have a fixed relation, how can a fixed relation reduce a foundset if your definition is that it always has to show all records? It would behave exactly this way in any other environment.