Setting a FileMaker field which is not on the current layout

Hi all

I notice that the “set cell” command generates an error in FileMaker Pro, if the field you are setting is not on the current layout. Does anyone know of a way round this, perhaps with a different command which does not have this restriction?

Cheers

Wanderer

In FileMaker 7 you can have several tables in one file. Each layout belongs to a particular table (actually it belongs to the table occurrence of the base table).

It is even possible, by creating a File Reference and a table occurrence, for a layout to be showing the records of a different file, as local (strange but true).

Hence, if you want to reference a cell which is not on the current layout (which is the AppleScript default), then you have to specify it.

It is also important to understand the difference between the terms: database, document, window. They are not quite the same as they were in 6. “document 1” for instance is the 1st document opened this session, whereas “window 1” is the frontmost document (also the default).

“database” does not have a “current record”. It is more like the entire file, whereas “document” is like the found set, hence it may have a current record (if there is a found set). It must also be either the current layout, or a specified layout.

“layout 0”, an old trick for all fields, is now just the 1st table occurrence created, all the data. It is the same as “table 1”, which is also the 1st table occurrence. It is not the layout. If you delete that 1st table occurrence (unlikely), then recreate it, “layout 0” will be the 2nd table occurrence created!

AppleScript only sees table occurrences (the ones on the Relationship Graph), not “base tables,” which are the ones you define in the Fields tab. It is a little confusing, but table occurrences are what really matters.

There is a hierarchy chart in the file “Apple Events Reference.fp7”, in the FileMaker application folder, in English Extras, and a few examples. Experiment.