before entering into Find Mode, set a variable $var with the Get( RecordNumber ), so you can return to it ( provided that records will have the same sort and the same found set.)
A variation on Raybaudi's suggestion is to store the record's primary key in a global field. (A primary key uniquely identifies the record--usually an auto-entered serial number in FMP).
Then you can build a relationship linking the global field to the Key field and use Go To Related Record (GTRR) to put it back as the current record.
To learn more about the GTRR step, see: The Complete Go To Related Record
Thank you for your response.
Unfortunately, I did not write this script as I do not know FMP programming.
Could you provide me with the excact code to place in my script?
Thank you again,
Thank you for your post.
Following is your script with extra lines marked with an asterisk:
In the first statement added, we are using the example provided by "raybaudi". That is, storing the current record to a variable $record.
In the second statement added, once no records are found, we return to the original layout, show all records, and then go to the original record. When you select the "Go to Record/Request/Page" script step, select the option "By Calculation..." and enter: $record
Let me know if you need additional information or clarification.
Thanks for the info TSGal.
I having a problem entering the 'Set Variable [ $record ; Get ( RecordNumber ) ]' line in my script.
I'm adding the 'Set Variable' line to the script and using $record in the 'Set Variable Options' Name box. I can't find how to enter the "Get ( RecordNumber )" to the line though.
Can you help me with this?
Type Get ( RecordNumber ) in the next box down in the same dialog box.
Thanks for the reply.
when I enter 'Get ( RecordNumber )' in the Value box in the 'Set Variable Options' box, it outputs the entire line in the script as...
Set Variable [ $record ; Value:Get ( RecordNumber ) ]
I can't get it to output the line without "Value" added in there.
When I run the script, it presents the user with a "Specify Number" dialog box which when OK is clicked does take you back to the original record before the search was started.
Any way to get this to work without the 'Specify Number' dialog box appearing?
The word Value: is supposed to be there. TSGal made a minor error in leaving that word out of her example.
Just enter the expression as directed and you'll be good to go.
"before entering into Find Mode, set a variable $var with the Get( RecordNumber ), so you can return to it ( provided that records will have the same sort and the same found set.)"
Would using Get(RecordID) as the variable not get around this?
Go To Record[by calculation] Requires the Record Number, not the RecordID. If we had a Go To RecordbyRecordID script step, then you could use the recordID value.