Separation Model: GtRR in Interface file

General support questions.
Posts: 4
Joined: Mon Oct 31, 2005 7:54 am
PostPosted: Fri Jul 21, 2006 2:42 am
I have a large data file and several interface files, each with no tables of their own, but many layouts which reference the external data tables.

I am having trouble navigating from a record in one interface file (Students) to a related record ("Advisor" in the Employees file) in a different interface file.

1) How can I apply GtRR if the interface file has no tables?
2) If I have a found set of say 10 records in the data file, how can I navigate to a layout in the interface file, maintaining the Sort Order, if possible?

Thanks for any push you can offer!

DSW
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Fri Jul 21, 2006 6:31 am
Good questions. This is definitely where the interface file thing gets tricky: multiple interface files. Not that its a bad idea. We do this frequently and often have separate interface files for reports, dashboards or charting.

As you've noticed, though, GTRR isn't the same when you're moving from one interface file to another. There are 3 techniques we use to move a record or found set from one interface file to another...

Found Sets.

Import Export. You can use a variant of the update-matching-import trick to move found sets. However, since you can't import directly from the same base table to itself, you'll have to export your match field and a dummy field to another location and then import from that location to perform your import. While this does move the found set quite well, it does not carry the sort order with it.

Finds. When the found set is something you can describe programatically ("Bob's Sales" or "Invoices in July") instead of an ad hoc found set, you can recreate the found set in the other interface file by scripting the whole thing: simply performing the same or a similar find in the new interface file. This is generally how we move single records into focus from one interface file to another, and how we do most found sets when marking reports. This obviously doesn't work for ad hoc found sets and also fails to carry the sort order.

Global Field GTRR. For ad hoc found sets you can also gather all the IDs from the found set into a global field in the new interface file and then perform a GTRR within the new interface file from that global field. Subject to some length limits this works great though it also fails to carry the sort order.

Sort Orders.

Most of the time we have a sort that we know programatically--we know the sort order of a portal or the sort we employed in a script--and we simply script that sort order in the second interface file. You obviously can't do this for ad hoc sorts were a user has just sorted a found set by hand somehow.

In those cases I don't believe there is any simple, multi-user-safe way to move the found set's sort from one file to another. Techniques that involve marking the records or setting their IDs to an indexed field for a value list sort all offer the opportunity to bump into another user.

While we've never had a need for this, I believe you *could* move an ad hoc sort like this: a) use a loop or a custom function like AppendNth to populate a a global field with a list of the found set's IDs in the same order as their current sort order; then b) using an unstored calc in the data table, calculate each record's position in that list and sort on this calculated position field.

HTH.
Last edited by John Sindelar on Fri Jul 21, 2006 6:52 am, edited 3 times in total.
John Sindelar
SeedCode
Posts: 4
Joined: Mon Oct 31, 2005 7:54 am
PostPosted: Fri Jul 21, 2006 6:38 am
This is very good stuff. I certainly appreciate your time and energy here.

I kept banging up against this and assumed I must be missing the boat in some way.

In the end, I think I will use GtRR to get to the right found set in the Data file, use GetNthRecord to collect the found set of ID's, place these in a Global field, GtRR to get to the second interface file, and then provide likely Sort option labels on the destination layout.

So, I will take some combination of your suggestions here.

Again, receiving this comprehensive overview is very confirming. You have my significant gratitude.

DSW

Return to General Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron
(855) SEEDCODE
[email protected]
Follow us: