Re: fileMaker Value Lists
Re: fileMaker Value Lists
- Subject: Re: fileMaker Value Lists
- From: "Gary (Lists)" <email@hidden>
- Date: Thu, 13 Sep 2007 11:27:17 -0400
- Thread-topic: fileMaker Value Lists
"Oakley Masten" wrote:
> Oakley now writes
> OK Gentlemen In a attempt to ask what I thought to
> be a simple question I did not provide enough
> information.
> Please, let me try again.
OK, first things first.
Fix your quoting in your mail client. This 20 characters per line thing is
not working for me.
Now, second things second.
Your question got more muddy, not more clear.
"Bruce Robertson" wrote:
> 1. Sorry I still cannot understand your explanation.
Yes, agreed.
One problem which can arise when asking questions to any mailing list is the
"too many specifics" problem. (Surely, to be balanced with the "not enough
information" problem, but that's more to do with goals rather than methods.)
In general, and until an approach is well-defined, it's best to keep things
in the abstract.
That is to say: "How do I retrieve the list of defined values from a value
list in FileMaker?" is better than "I have 14 fields, with 72 items in a
popup menu that my boss wants sorted into departments. How do I do that?"
The second one of those is way too dependent on the specifics of your
database set-up (value lists can come from pre-defined lists, can be
aggregated from in-use values from one or more fields, or can be generated
by other means.)
So, to the question "How do I retrieve the value list of possible values for
a field?"
Well, use the 'choices' property:
tell document "untitled" to choices of field "MyPopUpOne"
-- {"Apple", "Banana", "Cantaloupe", "Date"}
tell document "untitled" to choices of field "MyPopUpTwo"
-- {"Ale", "Lager", "Porter"}
Now, you have a list of what the attached value list to both those fields.
It's a matter of elementary AppleScript to now loop around and get field
data for fields which have one of those list items. (Although that's still
inefficient.)
In the case shown above, I pre-defined the value list for field
"MyPopUpOne", but I let a whole other field provide the possible entries for
field "MyPopUpTwo". That is, 'MyPopUpTwo' has possible values which come
from a third field, and the value list keeps growing as new items are
entered into that third field.
This is NOT telling me the actual VALUE(s) of any specific field at this
point. It's just telling the list of values in the value list.
Then, you can do your looping or whatever you want to get the values for any
given field:
tell document "untitled" to ...
tell current record to its cellValue of cell "MyPopUpOne"
-- "Cantaloupe"
OR, generally equivalent:
tell document "untitled" to ...
tell current record to its field "MyPopUpOne"
-- "Cantaloupe"
Now, because of the nature of the 'choices' property, you will be MUCH
better off taking the advice of several folks here and using FIELDS to
manage value lists rather than value lists that are pre-defined.
That is, create a value list name, but tell that VL to get its values from
some field. Make that "some field" a field that is not really on your
layout (for the user), but rather on a special layout (I use a 'dev' layout
that has these things, and I hide it from user view, but access it via
script.)
If you do use a value list from field, then, as has been said, you can do
all your sorting and such right inside FM by using grouping and reporting
functions and you won't need to manually loop through all those records and
operate on each of them.
FileMaker does some pretty sophisticated reporting, if you use the proper
layout objects.
That is beyond the scope of this list, however, and I'd take the earlier
advice to join up with some FileMaker list or web forum or something (I hate
web forums, so I would go the list route if it were me. The FM-Experts list
is generally pretty good, even if a little snooty and ad-heavy from time to
time.)
Anyway, maybe that 'choices' property will help you get a handle on your
needs, and then when you've worked out a general workflow with all your
departments and spreadsheets (a silly way to manage data, but okay, whatever
the boss wants, even if it's stupid, I guess) you can ask here about actual
AppleScript-related methods or problems.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden