dbTalk Databases Forums  

moving the record pointer using RecordID

comp.databases.filemaker comp.databases.filemaker


Discuss moving the record pointer using RecordID in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
GSteven
 
Posts: n/a

Default moving the record pointer using RecordID - 01-25-2010 , 07:21 PM






I have a transaction table with 50K records in it There is a field called
"period" (YYMM) which is the billing period this record belongs to. I want
to locate the record before the first record in a given period.

I perform a find on the desired period (ex period = "1001") which returns 43
records which I sort (by TransactionDate) then go to the first record. I set
a variable to that RecordID number (in this example 36873). Then I extend
the found set by setting the period to "" and perform the find. This returns
385 records and the record pointer moves automatically to the first record
in the new found set. After sorting the records again I wanted to be able to
move the record pointer back to my RecordID but 36873 is beyond the scope of
the currently found set of 385.

Shouldn't this be easier than this?

Reply With Quote
  #2  
Old   
Your Name
 
Posts: n/a

Default Re: moving the record pointer using RecordID - 01-25-2010 , 11:28 PM






"GSteven" <GSP@DavClaServ> wrote

Quote:
I have a transaction table with 50K records in it There is a field called
"period" (YYMM) which is the billing period this record belongs to. I want
to locate the record before the first record in a given period.

I perform a find on the desired period (ex period = "1001") which returns
43
records which I sort (by TransactionDate) then go to the first record. I
set
a variable to that RecordID number (in this example 36873). Then I extend
the found set by setting the period to "" and perform the find. This
returns
385 records and the record pointer moves automatically to the first record
in the new found set. After sorting the records again I wanted to be able
to
move the record pointer back to my RecordID but 36873 is beyond the scope
of
the currently found set of 385.

Shouldn't this be easier than this?
RecordID is an internal serial number given to each record, but unless
something has changed in newer versions of FileMaker (I had a very quick
look in FileMaker 9, but may have missed it)you can't actually "go to" that
record. The Script command Go To Record[Num] will go to record in position
Num within the current Found Set's Sort Order, not the record with the
RecordID of Num.

To "move the record pointer" you would have to perform a looping Script to
work through each record until it finds that same RecordID or reaches the
end of the Found Set without finding it.
e.g. Something like:

Go To Record [First]
Loop
Exit Loop If [Get(RecordID) = g_StoredRecordID]
Go To Record [Next, Exit After Last]
End Loop
If [Get(RecordID) <> g_StoredRecordID]
Display ["Error: Record not in Found Set."]
End If


Helpful Harry )

Reply With Quote
  #3  
Old   
GSteven
 
Posts: n/a

Default Re: moving the record pointer using RecordID - 01-26-2010 , 09:20 AM



Thanks Harry,

That's exactly what I wound up doing, even though it seems mighty labor
intensive to have to shuffle through all records until I find the match. I
hate to think of what happens when my 50K records becomes 500K?

IMHO this (not having a function to go to a recordID number) looks like a
major blunder on FMs behalf.

Thanks again,
Steve

"Your Name" <your.name (AT) isp (DOT) com> wrote

Quote:
"GSteven" <GSP@DavClaServ> wrote in message
news:1412d$4b5e42fc$d1a8fa82$16562 (AT) EDELTACOM (DOT) COM...
I have a transaction table with 50K records in it There is a field called
"period" (YYMM) which is the billing period this record belongs to. I
want
to locate the record before the first record in a given period.

I perform a find on the desired period (ex period = "1001") which returns
43
records which I sort (by TransactionDate) then go to the first record. I
set
a variable to that RecordID number (in this example 36873). Then I extend
the found set by setting the period to "" and perform the find. This
returns
385 records and the record pointer moves automatically to the first
record
in the new found set. After sorting the records again I wanted to be able
to
move the record pointer back to my RecordID but 36873 is beyond the scope
of
the currently found set of 385.

Shouldn't this be easier than this?

RecordID is an internal serial number given to each record, but unless
something has changed in newer versions of FileMaker (I had a very quick
look in FileMaker 9, but may have missed it)you can't actually "go to"
that
record. The Script command Go To Record[Num] will go to record in position
Num within the current Found Set's Sort Order, not the record with the
RecordID of Num.

To "move the record pointer" you would have to perform a looping Script to
work through each record until it finds that same RecordID or reaches the
end of the Found Set without finding it.
e.g. Something like:

Go To Record [First]
Loop
Exit Loop If [Get(RecordID) = g_StoredRecordID]
Go To Record [Next, Exit After Last]
End Loop
If [Get(RecordID) <> g_StoredRecordID]
Display ["Error: Record not in Found Set."]
End If


Helpful Harry )



Reply With Quote
  #4  
Old   
Your Name
 
Posts: n/a

Default Re: moving the record pointer using RecordID - 01-26-2010 , 02:02 PM



"GSteven" <GSP@DavClaServ> wrote

Quote:
Thanks Harry,

That's exactly what I wound up doing, even though it seems mighty labor
intensive to have to shuffle through all records until I find the match. I
hate to think of what happens when my 50K records becomes 500K?

IMHO this (not having a function to go to a recordID number) looks like a
major blunder on FMs behalf.

Thanks again,
Steve

Another way would be to use a Relationship. Have a Global field with
"ThisRecord" in it, then instead of grabbing the RecordID, simply set a flag
field to "ThisRecord", then the Script can just use the Go To Related Record
[] command (via the Relationship Global = Flag) and remember to clear the
flag field when you get there ready for next time.

I don't know if that would be any quicker in reality with LOTS of records
though.

Helpful Harry )

Reply With Quote
  #5  
Old   
Your Name
 
Posts: n/a

Default Re: moving the record pointer using RecordID - 01-26-2010 , 11:14 PM



"GSteven" <GSP@DavClaServ> wrote

Quote:
Thanks Harry,

That's exactly what I wound up doing, even though it seems mighty labor
intensive to have to shuffle through all records until I find the match. I
hate to think of what happens when my 50K records becomes 500K?

IMHO this (not having a function to go to a recordID number) looks like a
major blunder on FMs behalf.
Not really a "major blunder". There are a lot of what are now called "Get"
functions that in older versions of FileMaker were more perhaps correctly
called Status functions which allow you to retrieve various values /
statistics of the database that are useful to know, but mostly meaningless
to try and change (e.g. Found Count).

Helpful Harry )

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.