Design Functions - File Maker

The design functions return information about the structure of your databases. The structure includes everything that you build, such as the layout names, the field positions, the scripts, and the relationships.

The most useful area for the design functions is to help third-party tools access the structure information of your FileMaker system. Tools such as Analyzer and Brushfire make heavy use of these functions in order to provide the reporting that they produce. If you don’t want to purchase these tools, you can duplicate much of the functionality that they provide by using the design functions.

Many of the design functions return data about a particular field on a particular layout. If the field isn’t on the layout specified, then an empty string is returned.

If and when you use the design functions, try to make them as portable as possible. For instance, every design function requires a database name. In the process of building a system, you may perform a Save As to duplicate a database so that all the functionality you have built into one database module is in a new module, or you may use FileMaker’s Developer Tool to change the name of a database already in use. In either case, if you hard-code the name of the database into the parameters sent to design functions, the functions won’t work anymore.

The work-around for this is to not hard code database names, but use the Status (Current FileName) function instead. Theoretically you could also use the Status (Current LayoutName) function wherever a layout name is required, but whereas you are usually in the database that you want to perform a design function on, you may not be on the layout that you are interested in.

DatabaseNames

Value Returned: text.
Returns a list of the currently open databases separated by carriage returns. To calculate whether a specific database is opened, use the PatternCount function:

FieldBounds(dbname, layoutname, fieldname)

Value Returned: text.
Returns the coordinates of the specified field on the specified layout. The coordinates are specified in pixels from the top left corner of the layout. Printer options don’t affect this number, so the results that you get may not be the same as the numbers that you see in the size palette. This function also returns the rotation of the field in degrees rotated counterclockwise. Each number in the list is separated by a space. If the field isn’t on the layout specified, an empty string is returned:

(assuming that the left edge of the field is 26 pixels from the left edge of the layout, the top edge of the field is 59 pixels from the top edge of the layout, the right edge of the field is 300 pixels from the left edge of the layout, the bottom edge of the field is 100 pixels from the top edge of the layout and the field has no rotation)

FieldIDs(dbname, layoutname)

Value Returned: text.
Returns a list of the field IDs that are on the specified layout in the specified database. Record IDs are assigned sequentially in the order that the fields are created. The layout parameter is optional. Leaving it out returns a list of all the IDs in the database. You exclude a layout name by using an empty string in the place of that parameter. If the layout is specified and related fields are on the layout, then those fields are referenced by the relationship ID followed by two colons and then the field ID of the field in the database that it exists in. If a field is included more than once on the layout its ID is included in the list only one time. Each field ID is separated by a return:

FieldNames(dbname, layoutname)

Value Returned: text.
Returns a list of all the field names on the specified layout. If no layout is specified, all of the fields in the database are included in the list. Each field name is separated by a return:

FieldRepetitions(dbname, layoutname, fieldname)

Value Returned: number.
Returns the number of repetitions that are shown on the layout followed by the orientation of the field repetitions (horizontal or vertical). The number of repetitions shown on a layout can be less than the number of repetitions that a field has:

FieldStyle(dbname, layoutname, fieldname)

Value Returned: text.
Returns the field formatting of the specified field on the specified layout. There are six options that can be returned: Standard, Scrolling, Popuplist, Popupmenu, Checkbox, and RadioButton. If the field has a value list associated with it, the name of the value list is returned also:

Value Returned: text.
Returns the type of the field specified in four pieces of data. The first returns whether the field is a standard field (i.e., text, number, date, time, or container), a stored calculation, an unstored calculation, a summary field, or a global field.

The second piece of data is what kind of field it is or what the result of the calculation is (text, number, date, time, or container).

The third piece of data is whether the field is indexed. The last piece of data is the number of repetitions that is defined. A 1 is returned if the field isn’t a repeating field:

GetNextSerialValue(dbname, fieldname)

Value Returned: text.
Returns the next serial number value for the specified field:

LayoutIDs(dbname)

Value Returned: text.
Returns a list of all the layout IDs for the specified database. Layout IDs are assigned sequentially in the order that the layouts are created. The first layout is ID 1, the second 2, and so on.

LayoutNames(dbname)

Value Returned: text.
Returns a list of the layouts in the specified database. The order of the layouts is the order that they were created in so that the names in the list that this function returns will match the IDs in the list that LayoutIDs returns.

RelationIDs(dbname)

Value Returned: text.
Returns a list of the relationship IDs for the specified database. Relationship IDs are assigned by the system in the order that the relationships are created so that the first relationship ID is 1, the second is 2, and so on.

RelationInfo(dbname, relationname)

Value Returned: text.
Returns information describing the specified relationship. The pieces of information returned are separated by carriage returns. They are, in order:

  • Name of related database.
  • The local match field.
  • The foreign match field.
  • The options that define the relationship such as delete related records, allow creation of related records, and sort related records.

(assuming that the related database is called Child, the match field is FileID on both sides of the relationship, and "Allow creation of related records" is checked)

RelationNames(dbname)

Value Returned: text.
Returns a carriage return–separated list of the relationships in the specified database. The relationships are provided in order of increasing relationship ID so that they match the IDs provided in the RelationIDs function.

ScriptIDs(dbname)

Value Returned: text.
Returns a carriage return–separated list of the script IDs for all the scripts in the specified database. Script IDs, like the IDs of all the other objects in FileMaker, are assigned sequentially in the order that the scripts are created.

ScriptNames(dbname)

Value Returned: text.
Returns a carriage return–separated list of all the scripts in the specified database. The script names are listed in the order of the script ID so that the list can be matched with the list of script IDs from the ScriptIDs function.

ValueListIDs(dbname)

Value Returned: text.
Returns a carriage return separated list of all value list IDs in the specified database.

ValueListItems(dbname, value list)

Value Returned: text.
Returns a list of the available values in a value list.

ValueListNames(dbname)

Value Returned: text.
Returns a list of the value lists in the specified database.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

File Maker Topics