Title
Paired-down drop-down options
Post
Hello Forum,
I have a programming challenge in which I have a table of people’s initials versus a list of their qualifications. Then I have a second database that has duties complete with drop-downs of the people’s initials. Unfortunately, the drop-down shows everybody, when what it really should show is only those individuals who are qualified in that area and aren’t tasked to another duty.
The bottom line is, I’d like to mull over an example file that successfully demonstrates a similar challenge. Does anybody have one?
Thank you in advance for your insight.
http://fentonjones.com/New/Tasks_vs_people.fp7.zip
This has two things it needs to do.
1. Match "qualifications". These must be the same in both Task and People.
2. Eliminate people already assigned.
#2 is more difficult. This is known as "dwindling". It needs to assemble a list from all people assigned to ANY task, so it can then omit them. One way is to use an "X" (any, Cartesian) operator, via a self-relationship in Tasks. Another would be to use a Value List of the same, and use ValueListItems (Get(FileName), "value list name") to get them. It may be faster, but you'd need to hard-code the name; which I try to avoid.
To omit them you use "≠" (does not equal) as the operator. But that needs at least one value to work, so a dummy value is used if the above list is empty.
It also requires a bit of a "kick upside the head" to refresh the value list. So a script trigger runs to Commit Record, then Refresh [ flush cache join results ].
Because the Value List may have no values after you choose the person (if there's no one else with matching skills left), a regular "straight" relationship to a table occurrence of People is used to show the name. You'd want it anyway. The choice is a drop-down rather than a popup showing only the name. The drop-down is hidden behind the arrow graphic.