Search code examples
externalfilemaker

Is it possible to import an external data source


I would like to import an external data source into another file. The way the work flow is distributed right now makes no sense and having the layout open in another window is not really needed.

What I'd like to do is import the whole external file(databases, records, layouts, and scripts) into the first file. Is it possible to automate this process or do I have to import everything manually step-by-step?


Solution

  • There is no automatic way to import code from one FileMaker file to another.

    External file references, custom functions, tables, fields, value lists, themes, layouts, scripts, layout objects, menus, ... have to be painstakingly moved by hand, bit by bit!

    Order!

    Most important is the order in which you do things!

    Do it in the wrong order, and references break because the referenced thing has not yet been created in the target file.

    The chicken / egg conundrum

    Even then you still get "what comes first? chicken/egg" conundrums - due to cyclic references.

    For example a layout-button might reference a script, and the script might reference the layout the button is in.

    => That means, if you create the layout first (layout, layout-settings, layout-parts, contents and all) the [Button] breaks (because the script is missing) and if you create the script first the Go to Layout breaks (because the layout is missing). :-/

    For this reason you often have to create the object "shells" before you create the contents.

    In the given example you would do this:

    1. First create the empty layout (and layout parts with the correct heights)
    2. Then import (or copy/paste) the script
    3. Finally copy & paste the layout contents

    Like this, the script can reference the layout ok and the button can reference the script ok.

    Useful resources

    • Geist Interactive have a good post Checklist moving FileMaker code explaining which order to use.
    • My toolbox fmWorkMate (from www.fmworkmate.com ) and particularly the fmLogAnalyser tool is very useful for catching and tracking breakages when copying and pasting code