Re: Filemaker checking value lists
Re: Filemaker checking value lists
- Subject: Re: Filemaker checking value lists
- From: Ehsan Saffari <email@hidden>
- Date: Sun, 15 Apr 2001 04:15:58 -0600
On 14/04/2001 23:11,cheshirekat <email@hidden> wrote:
>
I'm trying to clean up a Filemaker Pro 5 script that I have with better
>
error checking. I need to check to make sure that cells are being filled
>
correctly. One cell is a popupmenu with data from a value list.
>
>
My script accidently filled in a value that was not in the list for
>
nearly 50 records. Oops. It was a typo I didn't catch. I realize that I
>
can lock the popupmenu so that only those choices defined in a value list
>
are used without having "Other..." or "Edit..." but I don't want to do
>
that. There are other times, when inputting data manually that I need the
>
"other" and "edit" options. Since the script runs without intervention, I
>
would like for it to halt if a value that is not in the value list is
>
passed. Is there any way my AppleScript can check the value against the
>
items in the value list? I can't find an example of extracting the items
>
in a value list so that I can compare the value the script is prepared to
>
input.
>
>
Thanks
Hello
Validation is best applied as part of the field definition, it can be
strict or overridable, the field can be validated against a particular
value list. This requires no code execution (FM or AS). Check the Field
Definition dialog for the validation options. Also note that there is a
ValueListItems() function under the design functions that returns the VL
items, should you wish to validate by script, for when validation needs
to be applied after entry.
In AS you can also get the choices list property of the field class:
choices list [r/o] -- The value list for the field
tell app "FMP" to set meow to choices list of field "kategory" of
database 1
cheers
ehsan