I recently attended a PauseOnError session by Danny Mack on leveraging FileMaker internal IDs. This blog post will demonstrate the method he showed to copy portals for use in a different context with minimal work.
Traditionally, when you copy a portal to a layout that has a different context, you need to redefine the copied portal, its fields, and other things like conditional formatting. This technique eliminates much of this work. I have attached a sample file so that you can try out the technique for yourself in a simple way.
The sample file copy_portal.fp7 has three tables: Parent_One, Parent_Two, and Child.
Step 1: Copy the portal Child__original_context to clipboard
Step 2: EnterÂ relationshipÂ graph and duplicate theÂ Child__original_context tableÂ occurrence. You will notice the duplicated tableÂ occurrenceÂ now has a number 2 following its name.
Step 3: Establish the relationship from Child__original_context 2Â to the tableÂ occurrence Parent_two
Step 4: Rename the tableÂ occurrenceÂ Child__original_context toÂ Child__original_contextx.
Step 5: Rename the duplicatedÂ tableÂ occurrence to Child__original_context
Step 6: Go to layout Parent_two and paste the portal that you copied to the clipboard in step one onto the layout. Â You will see the correct context for the portal and the field it contains. Â When you enter browse mode, the correct data will be displayed.
Step 7: Go back into the relationship graph and rename the tableÂ occurrenceÂ Child__original_context toÂ Child__original_new_context. Then renameÂ the tableÂ occurrenceÂ Child__original_contextx back toÂ Child__original_context.
Step 8: Click ok and you have successfully copied a portal to its new context and retured everything else back to its original state.
Using this time-saving technique the other day, I copied 25 tableÂ occurrences, their established relationships, several portals (in one copy), and a lot ofÂ conditionalÂ formatting all using the same steps above. You can imagine how much time that saved!
If you have found this technique helpful or have any tips or suggestions to make it better, please leave a comment.