Re: FileMaker 9 finds
Re: FileMaker 9 finds
- Subject: Re: FileMaker 9 finds
- From: Bruce Robertson <email@hidden>
- Date: Mon, 10 Nov 2008 14:45:59 -0800
> At 8:17 AM -0500 11/10/08, Bill White wrote:
>> I'm having a terrible time porting many mission-critical scripts from FMP 6
>> to FMP 9 and I'm sure much of it has to do with the trouble I'm also having
>> wrapping my head around the new table/database structures.
>>
>> For example, a simple find that worked in FMP 6...
>>
>> tell application "FileMaker Pro"
>>
>>
>>
>> show (first record of database "Clients" whose cell "Client number" is
>> "12345")
>>
>>
>>
>> end tell
>
>
> This will work for me.
>
> tell application "FileMaker Pro"
> show (first record of table "BBEditLists" of database "MailingLists.fp7" whose
> cell "Serial No." is "561")
> end tell
>
> Where "Serial No." is a text cell.
>
> Joe
That should not work and should not be expected to work.
You cannot show a table.
A table is the underlying data table.
A table has no found set and no sort order and you cannot perform finds in a
table and it is always in creation order and users never actually see
tables.
Remember that Filemaker since 7.0 can have multiple tables per file and
multiple layouts and the layouts can be based on different table
occurrences.
So you need to be much more specific now. If trying to view records you must
do things more like an actual user. And users select layouts from windows.
If you want to see particular records then you need to select LAYOUTS.
tell application "FileMaker Pro"
Tell database "MailingLists.fp7"
show (first record of layout "BBEditLists" whose cell "Serial No." is
"561")
End tell
end tell
If you are trying to set or get data using a layout reference then the
fields you are calling on must exist on the layout you are calling.
Table references can be very handy, and they do not require fields to be on
the layout. You can address any table whether that table has data on the
currrent layout or not.
-- I could be on layout "Invoices" but this would work
-- because it is calling on a table reference
get ID of every record of table "Members" whose cell "LastName" = "Smith"
set firstID to item 1 of result
set recordRef to a reference to record ID firstID of table "Members"
cell "State" of recordRef
_______________________________________________
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