3 Replies Latest reply on Sep 7, 2010 3:25 PM by philmodjunk

    2 file buffers open at the same time?

    DanParadis

      Title

      2 file buffers open at the same time?

      Post

      Is it possible to have two files available at the same time?  Either two of the same record via something like an "alternate buffer" or even two different files (i.e. Events and Events_Contacts).  Or do you have to save the info you need from the first file into variables before accessing the next file?

      Thanks.

      Dan

        • 1. Re: 2 file buffers open at the same time?
          philmodjunk

          I think you want different table occurrences to the same data-source table here.

          Each table (called a data source table) you create in Manage | Database | Tables creates a box on the Relationships tab with the same name. This box is called a table occurrence. You can create additional table occurrences as needed for your solution.

          Each such table occurrence has it's own current record, found set and sort order for a given window and I think this is what you are looking for here. You can also use these additional table occurrences to build different relationships between the same data-source tables for different purposes.

          For more on Table Occurrences: Tutorial: What are Table Occurrences?

          • 2. Re: 2 file buffers open at the same time?
            DanParadis

            Thanks for the response.

            However, I think I finally have a pretty good handle on the Relationships tab (and love it).

            What I want is to have two different tables information available at the same time.  I'm guessing it's possible, since I believe every other programming language allows it.

            For example:  I have a table called Customer and another called Events.  To access Customer I use its layout and read the records.  Now if I want the Event records in the same script I use its layout and read the records.  However, now the Customer record information is no longer available!  Is the solution to create a layout with fields from both tables on it?  Am I explaining this properly?

            Thanks,

            Dan

            • 3. Re: 2 file buffers open at the same time?
              philmodjunk

              Actually, it's usually possible just to switch back and forth between layouts. You can freeze the window so that the layout switching isn't visible to the user. You can also put data from one layout in a "bucket" to carry with you to the other layout. You can put the data in a global field, a variable or pass it as a script parameter.

              Example: You can put the customer ID number from Customer in a variable, switch to an events layout and use the customer ID to find all event records for that customer.

              Don't forget that if you have a relationship between the two tables defined, you can reference (and also edit) related records in the related table without switching layouts, though sometimes this is easier to do even with the relationship in place. So, to refer to your last post, the customer information may indeed still be available if your event record that's "current" on the other layout is related to the customer record you need to reference.

              And yes, you can put records from both tables on the same layout in a number of different ways, though this may not be needed in order for your scripts to work.

              You might also want to research a script step called Go To Related Records:  The Complete Go To Related Record