Hi,
I have a form on a tab panel, based on a global relation.
Global value is called GlobalType and can have values SUPP, CUST, etcetera.
If i set global var to SUPP and do a find and search everything works fine
I only get records with field Type having value of SUPP.
However, when i use the “invert records” command, i also get records
which have other values (like CUST).
I would expect all other records having field Type=SUPP.
![Question :?:]()
Is this is a bug? At least it is not exepected behaviour ???
Please advice,
Hans
If i use “show all” on the form it will also display the “wrong” records with other values then SUPP.
I would expect that only records with the globaltype value would be displayed.
That is the reason i use a global relation !!
Hans
Hans,
Invert records should invert the search condition, e.g first search for companies in NL and use invert to find the non-dutch companies
When you do a related search this should work the same, e.g. you have a relation contact_to_companies and want to find all contacts for non-dutch companies: search contacts, related company.country = NL and use invert.
Unfortunately, in Servoy 3.1 the condition of the relation is negated also.
As part of the sql generation improvements this has already been fixed, so in 3.5 you should get the results you expect.
Rob
Thanks,
I wil test it and get back to you.
Hans
Hello Rob,
I tested it in 3.5
Servoy Client
Version 3.5 b5-build 505
Java version 1.5.0_11-b03 (Windows XP)
But still when i Invert (or Show all) i also get records that are not in the relation.
Hans
Hans,
We couldn’t reproduce this, please file a case on our support site and attach a sample solution that shows the problem.
Rob
I will make a small example and then mail it.
Regards,
Hans
i mean "file a case on your support site "
There are 2 methods for showing all records: controller.loadAllRecords() and controller.loadRecords()
As stated in the ref guide, controller.loadAllRecords() shows all records in the table, removing the dependency of the relation, controller.loadRecords() shows all records respecting the relation.
Rob
Thnx Rob.
I understand this.
There is also an “issue” with invert records using a related form.
This also works on he complete table and not within the relation.
I logged a case and the answer is that this behaviour may be changed in future release. I think it should be !!
I logged a new case regarding extend /reduce search within a related form. Reduce search respects the relation, extend search does not.
Regards,
Hans
Hans,
Both issues have been fixed for release 3.3 RC6:
- extend search will respect the relation condition
- invertRecords will invert the search condition and respect the relation condition.
Rob