Hi All,
I *love* the [relatively] new List() function.
As always, if the limitation I describe below is an indication of ignorance
of how to use the List() function or some other methodology that I am
unaware of then I will be thrilled to have my ignorance cured by you-all.
You just point it at the Primary Key through the relatonship of your
choosing and you have a list of the Keys of the Related Records.
However, there are times where you can arrive at a Found Set of records but
only *not* through a relationship, and you still want all the keys.
In this case you need to Kludge your way through building a layout with only
one field -- they key -- and then travel there with your found set in tact
and perform a CopyAll() step and then paste it somewhere and then assign it
to a $script variable or a $$session variable.
(Alternately, you could Kludge an on-the-fly relationship and use List() --
I am tending toward that these days, but still too kludgey.)
I wish that FMI would create a "list from found set" or a "targeted
copy-all". These are two ways of describing the exact same thing; yet one is
an enhancement of a Function and the other is an enhancement of a Script
Step -- so maybe both: ListFromFoundSet() functions and CopyAllTargeted()
script step.
I'll go with the "List Opton":
You could run, ListFromFoundSet("CustomerID") to return the exact same data
as you would with either kludge above.
Better yet. FileMaker should add the ability to have:
1. Optional Parameters
2. Default Values where Parameters are skipped (there are many cases where
the parameter can be one or more than one [Avg(), Sum() and so on]; but I am
unaware of a case where there can be none or more than none for parameters).
If that were the case it then both the function and the script step could
remain unchanged and backwards compatible, but allow an addition parameter
to both.
For fun I will swith to the CopyAll function and show how this would work:
empty parameters means "ALL" (so no change to existing scripts); yet the
optional parameter(s) would be one or more column names that should be
included in the CopyAll. [Also, the minute you begin to specify any
parameter at all, the function become layout INdependent -- and you can pass
in the string "ALL" and have that a layout INdependent expression copying
all fields of that table.]
So that CopyAll("CustomerID") would do the trick.
I hope that I am just ignorant and someone can clue me in to a way to effect
this elegantly with the existing feature set.
If not, just a wishlist.
FWIW: $0.02
Thanks.
--
Sincerely,
Brad