Solved

FileMaker Back Button by RecordID

Posted on 2008-06-13
13
1,048 Views
Last Modified: 2011-09-20
I need a back button, and it's not going to be easy.

The db I'm working on has >40 tables with over 100 layouts and (far too) many self-joins. I've installed Back Magic from Seed Code, but that only restores layouts and tabs, not individual records. The rest of the road I'm on has me stuck.

I tweaked back magic to store RecordIDs, as they are the only thing I can think of that is a universally accessible (meaning I don't have to specify what table::field I'm looking in), constant, unique identifier. So how do I get there? The self-join via global calc field method is impractical, as is using any single field name (all the table specific record ids are uniquely named and I really don't want to script a case statement that runs through every possible layout to determine which table and field to look at).

So, the only thing the internet has turned up as viable thus far is.... apple script. Here's what I have:
"set thisID to \"" & $recordID & "\" " & ¶ &
"tell application \"FileMaker Pro\"" & ¶ &
"tell database \"LR_Database\"" & ¶ &
"show record ID thisID" & ¶ &
"end tell" & ¶ &
"end tell"

and it works.... half of the time. The other times I get "Object Not Found" and "Unknown Error: -1728" anyone know why? anyone have any other ideas? If it can't be done in 30-45 minutes with less than 5 new table occurances, I can't do it.
0
Comment
Question by:mcpillsbury
  • 6
  • 5
  • 2
13 Comments
 
LVL 28

Assisted Solution

by:lesouef
lesouef earned 150 total points
Comment Utility
I am not sure 'show record', using the record ID works, because fm does not do it natively, so I doubt applescript can do it. try to remove that step as a test. if it turns out to be true, use recordnumber instead.
0
 

Author Comment

by:mcpillsbury
Comment Utility
But it does work- about half of the time FM correctly jumps to the record ID and the other half it tells me object not found. Why for some record IDs but not for others (for instance record ids 57-142 load whereas 143-299 do not)?
0
 
LVL 28

Assisted Solution

by:lesouef
lesouef earned 150 total points
Comment Utility
ok, ok... at=re these records still in the foundset when you try to display them again? or has the records foundset been changed in between by a further action?
0
 
LVL 9

Assisted Solution

by:jvaldes
jvaldes earned 40 total points
Comment Utility
Have you looked at a free product designed by seedcode called backmagic?
0
 
LVL 9

Assisted Solution

by:jvaldes
jvaldes earned 40 total points
Comment Utility
I think this solution will give you some great ideas on how to handle a back button, it did me...
0
 
LVL 28

Assisted Solution

by:lesouef
lesouef earned 150 total points
Comment Utility
I think you did not read the question Juan, that's where he started!
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:mcpillsbury
Comment Utility
the found set has changed. I'm ok with just displaying the record without the rest of the found set (in most cases it will be a record in one of three tables: People, People_on_Program, or Programs. we generally interact with these as individuals and not groups).
0
 
LVL 28

Assisted Solution

by:lesouef
lesouef earned 150 total points
Comment Utility
yes, but it must be present before you navigate back to it. so can you do a 'find all' before trying to locate the record ID? or use a find instead of show?
0
 

Author Comment

by:mcpillsbury
Comment Utility
sure- for that i need someway to set each table's id field on the fly. Do you know of a way to get the Set Field script step to specify a field by calculation?
0
 
LVL 28

Assisted Solution

by:lesouef
lesouef earned 150 total points
Comment Utility
I am not with you... set field can use any calculation, so where is the problem?
0
 

Author Comment

by:mcpillsbury
Comment Utility
sorry- let me clarify... I need to be able to set field based on context. If I'm on a layout that uses the people layout I need to search by person_id, for programs it's program_id. The set field step only lets me select from a list that references a specific field in a specific table.

To get around this I've tried Set Field with no field specified and then:
$table_and_field_name & "; " & $recordnumber
This mimics the Set Field [ Table::Field; Value ] format that the script editor uses, but doesn't actually evaluate out correctly. I've tried using the evaluate function in a number of creative ways as well, but that doesn't quite cut it either.

Thanks for sticking in here with me. I'm currently testing another AppleScript hack- passing the variable to AS and using it to generate the find request. So far I'm getting Unknown Error -10006 which I can't even find documentation for. Sigh.
0
 
LVL 28

Assisted Solution

by:lesouef
lesouef earned 150 total points
Comment Utility
so, you wanna switch to a field of which the name is in another field or variable...
no, you can't do this, only the repetition can be defined.
and all you can do with eval is get the value from a field of which you specify the name as the eval argument, but that won't work for set field. I can't say more now, I don't know the seedcode solution, and can't spend time on it right now.
0
 

Accepted Solution

by:
mcpillsbury earned 0 total points
Comment Utility
Well, it's not as elegant as I wanted and probably won't work over vpn, but I have an almost functional back button. It uses a slew of if statements to decide which field it should reference, and it has to run through it every time a layout/record change occurs and when the back button is pressed. I'll have to update the scripts every time I add a new table. Meh.

Thanks for your help lesouef- I'm going to close out the question.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Preface   In the first 100 days of the Macintosh release in January 1984, Apple sold 72,000 of the computers. Relatively cheap, easy-to-use personal computer with a graphical operating system. I've never seen this model. I did see this one:   …
CocoaPods is the best way to manage library dependencies in iOS and OS X projects. By using cocoa pods there is no need of downloading the code from github and copying to your project. There are plenty of open source libraries now available with C…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now