Product Logo

CNS Query

Query your databases without relationships.

Functions

CNSQuery_FieldExists

NameCNSQuery_FieldExists
Description

This function checks for the Existence of a Field in an existing Table. The first parameter is the Name of a Table Occurrence of the Table to look at for the Field. If you do not specify this parameter, CNS Query will use Get(LayoutTableName) to get the current Table to look at for the Field. The second parameter is the Name of the Field to look for. By default, CNS Query will check to make sure the TO Name you specify exists before searching it for the Field. If you already know for sure that the TO exists, you can pass True as the third parameter.

Return TypeNumber (1=True, 0=False)
FormatCNSQuery_FieldExists ( TOName ; FieldName ; SkipTONameCheck )
Required Parameters
TOName

The Name of the Table Occurrence to search. Specify “” to use the Current Layout TO. In FileMaker Pro 11 and above, you can optionally specify the Database Filename (without the “.fp7” extension) containing the TO in the format “FileName.TOName”.

FieldName

The Name of the Field to search for.

Optional Parameters
SkipTONameCheck

If True, the plug-in will not check to make sure the TO Name you specified actually exists before searching it for the Field.

Examples
Example 1

Returns 1 when a Field Named "AField" exists in a Table Named "MyTable".

CNSQuery_FieldExists( "MyTable" ; "AField" )
Example 2

Returns 0 when a Field Named "DoesntExist" does not exist in the current Table.

CNSQuery_FieldExists( "" ; "DoesntExist" )
Example 3

In FileMaker Pro 11 and above, use this form to add a check for a field in a Table Occurrence in a separate, open Database file.

CNSQuery_FieldExists( "AnotherFile.MyTable" ; "AField" )