Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

FileMaker Back Button by RecordID

Posted on 2008-06-13
13
Medium Priority
?
1,102 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 600 total points
ID: 21783425
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
ID: 21786125
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 600 total points
ID: 21786383
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 9

Assisted Solution

by:jvaldes
jvaldes earned 160 total points
ID: 21791489
Have you looked at a free product designed by seedcode called backmagic?
0
 
LVL 9

Assisted Solution

by:jvaldes
jvaldes earned 160 total points
ID: 21791493
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 600 total points
ID: 21791710
I think you did not read the question Juan, that's where he started!
0
 

Author Comment

by:mcpillsbury
ID: 21795277
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 600 total points
ID: 21795483
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
ID: 21795753
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 600 total points
ID: 21795979
I am not with you... set field can use any calculation, so where is the problem?
0
 

Author Comment

by:mcpillsbury
ID: 21796116
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 600 total points
ID: 21800293
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
ID: 21807077
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Loops Section Overview
Suggested Courses
Course of the Month12 days, 23 hours left to enroll

972 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