Level: Intermediate, Version: FM 8 or later, Video

Copying and Pasting Layout Schema

Has this ever happened to you? You have a number of identically named fields in two different tables…

2-23-2013 5-48-43 PM

…but when you copy one of those fields from a layout based on the first table…

2-23-2013 5-42-27 PM

… and paste it onto a layout based on the second one…

2-23-2013 5-45-14 PM

…the result is not what you might have wished for.

When you copy layout elements, FileMaker grabs an XML representation of those elements, including table occurrence (TO) info where appropriate, so what was copied was “CUS::zz_c_header”, not just “zz_c_header”, and the fact that the field shows up as coming from an “unrelated table” on the target layout tells us that “CUS” is not related to the TO the invoice layout is based on.

Of course the field can be manually repointed, and all will be well, but sometimes you find yourself copying/pasting many fields, in which case the following work around could be a real time saver:

  1. Go into layout mode on the source layout
  2. Select field(s), copy
  3. Still in layout mode, go to target layout
  4. Open the Relationships Graph
  5. Temporarily rename the source TO
  6. Temporarily rename the target TO to the original name of the source TO
  7. Close the Relationships Graph
  8. Paste onto the target layout
  9. Open the Relationships Graph and restore original TO names

In case the above isn’t completely clear, I’ve recorded a short demonstration video. It’s a little under 5 minutes in length, and since this is the first time I’ve posted a video, any comments and/or suggestions would be much appreciated. (If for some reason you can’t view the embedded version, you can download or view the full version here: PastingFileMakerLayoutSchema.mp4)

7 thoughts on “Copying and Pasting Layout Schema”

  1. Hi Kevin

    I’ve just been using this basic idea extensively – rebuilding an old .fp5 database into a separation model .fp7 version. In this case, I’m creating TOs in a new file with exactly the same name as in the old, pasting in the layouts, and then renaming the TOs (to anchor-buoy standards).

    It’s worth pointing out one thing that I’ve noticed:

    Some of my fields are not getting correctly contextualized. In this case it’s because they include square brackets [ and/or ] in the field name. I imagine there may be other special characters that cause this technique to fail.

    So if using this method extensively, it may be worth reviewing source field names and modifying them prior to the copy/paste.

    Steve

    1. Hi Steve, I completely agree. Back in the pre-7 days, I used to include “{“, “}” and “” in my relationship names. When it came time to convert, they wreaked havoc, so I ended up writing a QuicKeys routine to convert those characters to underscores.

  2. Matt P has an idea in his latest video, using clipboard explorer from Dracoventions (which is free)

    Copy the fields from TableA layout
    Grab the clipboard contents
    Copy the XML to the clipboard
    Go to Notepad++ or Textmate (etc etc) and do – Replace TableA:: for TableB::
    Copy to clipboard
    Paste into demo file
    Set as clipboard
    Paste back into TableB layout

  3. I’m using FMP11 Advanced on Windows 7. I was interested in John Renfrew’s suggestion of grabbing the XML from the clipboard, editing it and putting it back. I’ve tried notepad and jEdit (edits XML files) but when I paste into the editor, I get nothing.

    Am I missing a step ‘grabbing the clipboard contents’ somewhere?

    Thanks

    Brian

  4. If you’re using TextMate or Sublime Text 2, in the method outlined by John, you’ve got another option. You can install the FileMaker bundle for TextMate http://donovanchan.github.com/filemaker.tmbundle/ which provides functions to get and set the XML data from the clipboard with no need for other s/w. With Sublime Text 2 you’ll need the Sublime Text bundle also on GitHub.

    cheers
    ian

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.