Documenting the Scope of FileMaker Functions for better code...

Discussion created by TonyWhite on Feb 21, 2017

Hi All,

We have been polishing our Help Request and Error Logging routines and working on the concept of Scope in regards to FileMaker functions. (This would be useful information to add to the FileMaker documentation and would likely improve what we have so far.)

1. In a Help Request module, you will want the user to be able to create a Help Request from any File in the system and (as needed) pass a number of items (FileName, LayoutName, RecordID, etc.) to the Help Request File.

2. In an Error Logging module, you will be able to gather different (additional and runtime) information from a running script. (ScriptName, ScriptParameter, CurrentPrivilegeSetName, LayoutViewState, etc.)

The goal is to have the combined code in optimum locations based on the scope of the functions used...better for maintainability, readability, performance, etc.

Information is often gathered from the Get ( 116ToChooseFromInFM15upFrom95inFM11 ) functions where we can see that the scope varies by function...

For example:

  • Get ( ApplicationVersion ) is scoped to the Session and can be captured “DRY”ly in a single “_New Help Request” Script.
  • Get ( FileName ) is obviously scoped to the File.
  • Get ( ScriptName ) is scoped to the currently running Script and would therefore need to be captured from within a running script.
  • Get ( LayoutViewState ) might change as a script is running based on the use of the View As script step.

Here are some where I do not know the scope...yet:

  • Get ( HighContrastColor )
  • Get ( HighContrastState )

This one runs slow and should be used only with great caution:

  • DocumentsPathListing

Does FileMaker, Inc. have any documentation on the scope of the various functions? I would prefer not to re-invent the wheel.


Tony White