Filtered view in lookup dropdown
Filtered view in lookup dropdown
Is it possible to have a filtered view in a lookup drop down? For-example user can only choose customers which are not on-hold etc.
Re:Filtered view in lookup dropdown
Lookup/Multibox is a relational function.
It is a common misunderstanding that the relationship that the Lookup/multibox is based on should include the field itself.
This misunderstanding stem from the "likeness" with the CTRL-F10 functionality that one can suspect Multibox was designed to "replace".
If one want a simple dropdown without relational constraint one can use the "show all" checkbox on the Multibox Field Definiton as this will override any Relational Constraint.
An old trick is simply to use a relationship with only the tables defined and no columns.
If one include the Field itself in the relationship the dropdown will be restricted by its own value, so one will simply get all values when it is empty and only itself, when it has been selected.
So back to the question here.
If you want your Mutlibox to be restricted you simply build the relationship on supporting fields that will contain the restriction.
For example if we want to select first Country and then Cities in that country we have a Country Table then a City Table where country is a restricting field.
In our Input form we simply have a non restrictive relationship for selecting Country and then a Restricted Relationship for the Multibox where we select City where Country is the restriction.
Simples!
Re:Re:Filtered view in lookup dropdown
Back to this topic.
I made a simple modification into this app as attached.
I added a new field in order to filter data in the list. This new field called type is a virtual one with an hipotetic value of "F".
It works well at the first time , but after select an option if we click over another field and back again to select another choise the relationship is no longer working.
Any ideia of how can we solve it?
Tks
Afonso
Re:Re:Re:Filtered view in lookup dropdown
Afonso
Once you choose a value in the field, and then click to get / change to another value, the full list of data is displayed.
To avoid this do the following to the SelectRecordID field...
OML > On Click
define "Act"Text .
Act := SetValue("SelectRecordID" , "") .
This clears the field before the next selection, and hence the filtering is correct.
regards
Josef