4 Replies Latest reply on Jun 21, 2017 10:48 AM by eric

    Merging Two Table Occurrence Groups?

    eric

      Title

      Merging Two Table Occurrence Groups?

      Post

      Suppose you have two unrelated table occurrence groups:
      TOG1 with table occurrences  T1 = A1 = B1 and
      TOG2 with table occurrences  T2 = C2 etc.
      Without breaking layouts etc. based on TOG1 or TOG2,
      how do I merge the two occurrences so that T2 = A1 = B1 and T2 = C2 etc.,
      effectively replacing T1 with T2 in TOG1?
           Is there some order of table occurrence renaming and relationship deletion and creation that will keep all the table field reference intact throughout the file?

      Right now I've connected the two table occurrences together and I'm using the DDR to help manually replace every occurrence of "T1" with "T2" in every layout and script. Is there a faster way?

        • 1. Re: Merging Two Table Occurrence Groups?
          philmodjunk

               Not that I know of. But there's not enough detail in what you have posted to be able to answer with any certainty. You've listed table occurrence names, but the match fields and data source tables used with those TO's are also significant.

               Why do you need to merge the TOG's in the first place?

               Many DB systems have multiple unconnected TOG's in their relationship graph. That, in fact, can be an approach that is much easier to work with in many cases and is part of the rationale behind using the Anchor Buoy system of TOG's to better organize your relationships graph.

          • 2. Re: Merging Two Table Occurrence Groups?
            eric

                 The two table occurrence groups in this case are mostly redundant, but their layouts are not redundant.
                 (Though the anchor in each one is different, I intend to make them the same.)

                 Though the two groups are very similar, a found set in one does not reveal the same set when navigating to a layout based on the other group. This would also be resolved by merging the groups.

                 Assume the letters ( "T" etc.) are data source tables; the numbers are their occurrences. 

            • 3. Re: Merging Two Table Occurrence Groups?
              philmodjunk
                   

                        Though the two groups are very similar, a found set in one does not reveal the same set when navigating to a layout based on the other group.

                   This is often a useful feature, but Go to Related records can replicate the found set on Layout #1 in Layout #2 when both layouts are based on different TO's of the same data source table. It's a bit weird and not documented anywhere that I know of, but you select the same TO as your current layout as the "table", select "Show only related Records" and then select the layout #2 as the layout to switch to.

                   

                        Assume the letters ( "T" etc.) are data source tables

                   but the match fields and data source tables used with those TO's are also significant.

                   One way to redirect all fields in a layout to a new TO in one batch operation:

                     
              1.           Enter layout mode and select all layout objects. Group them (necessary step only in FileMaker 12 and 13) and make a note of the top, left positions in the inspector in points. (click the units until points appear.)
              2.      
              3.           Cut the selected objects to the clipboard.
              4.      
              5.           Open Manage | Database | relationships.
              6.      
              7.           Temporarily change the TO names so that each now has the name of the other. The original TO for the layout has the name of the TO to which we are redirecting and the new TO has the original TO of the TO we are discarding.
                          
                          Example:
                          Before you start, the Layout's TO is named "Apple" and the TO we want to use for the layout is named "Orange". Rename "Apple" to be "Orange" and rename "Orange" to be "Apple". You'll need to rename one of the two temporarily to a third name as FileMaker won't let you have to TO's with exactly the same name.
                           
              8.      
              9.           Click OK to close Manage | database and open layout set up.
              10.      
              11.           Select the new TO for the layout in Show Records From.
              12.      
              13.           Paste the group of layout objects back onto the layout.
              14.      
              15.           Edit the position boxes for Top, Left to reposition the group of layout objects exactly as they were when you cut them from the layout.
              16.      
              17.           Ungroup the selected layout objects.
              18.      
              19.           Return to Manage | Database | Relationships an return the TO's to their original names if you so desire.

                    

                   The more TO's involved in the design of the layout, the more complex these steps become as you end up renaming multiple TO's in each TOG, and I haven't tried this with a portal--so your mileage may vary if you need to do that.

              1 of 1 people found this helpful
              • 4. Re: Merging Two Table Occurrence Groups?
                eric

                That's pretty good for a single layout,

                but it won't fix references in multiple layouts, scripts, calculations, etc.