Re: filemakerpro, go to the next record
Re: filemakerpro, go to the next record
- Subject: Re: filemakerpro, go to the next record
- From: Bruce Robertson <email@hidden>
- Date: Sat, 10 Dec 2005 13:55:28 -0800
> try this ...
>
> tell application "FileMaker Pro"
> set myDatabase to the name of window 1
> set myCount to the count of records of document myDatabase
> --myCount = the number of records being browsed
> if myCount > 1 then
> set myRecordID to the ID of current record as integer
> --"as integer" is very important !!
> --"to the ID of curren record" -> returns 1.2599066E+7
> --"to the ID of curren record as integer" -> returns 12599066
> --FileMaker cann't go to the record ID 1.2599066E+7
> set nextRecordID to myRecordID + 1
> try
> go to record ID nextRecordID of document myDatabase
> on error errmsg number errnum
> display dialog (errmsg & " Nr. " & (errnum as string)) & return &
> "You have reached the last record." buttons {"OK"} default button 1
> with icon 0
>
> end try
> else
> display dialog "The count of current records is 1 and 1 is less
> then 2. Therefore \"go to next record\" is not possible." buttons
> {"OK"} default button 1 with icon 0
> end if
> end tell
Well; not really correct on several counts.
1. I have never experienced a need to get the record ID as integer. Merely
saying set recID to record ID of current record is good enough. Even though
it may display in scientific notation if you ask applescript to show you the
record ID that is not how it is actually stored.
2. It is very unlikely that the next record will have the next integer
value. The user may very well have picked a sort order that does not put the
record ID in sequence. Also, FileMaker record ID values frequently do not go
in integer sequence, there are some big jumps. And the user may have deleted
records.
3. The correct way to do this is to go to record after current record.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden