Product Logo

CNS Query

Query your databases without relationships.

Functions

CNSQuery_GetFieldValueByID

NameCNSQuery_GetFieldValueByID
Description

This function retrieves the Value of a Single Field from a Record with a specific ID. The first parameter is the Name of a Table Occurrence of the Table to Get the Field Value from. If you do not specify this parameter, CNS Query will use Get(LayoutTableName) to get the Current Layout TO to Get the Field Value from. The second parameter is the Name of the Field to retrieve. The third parameter is the Internal FileMaker Record ID of the Record to retrieve the Field Value from. If you do not specify this parameter, CNS Query will use Get(RecordID) to get the Record ID. By default, CNS Query will check to make sure the TO Name, the Field Name, and the Record ID you specify exist before attempting to Get the Field Value. If you already know for sure that the TO Name, the Field Name, and the Record ID exist, you can pass True as the fourth, fifth, and sixth parameters.

Return TypeVaries
FormatCNSQuery_GetFieldValueByID ( TOName ; FieldName ; FMRecID ; SkipTONameCheck ; SkipFieldNameCheck ; SkipFMRecIDCheck )
Required Parameters
TOName

The Name of a Table Occurrence for the Table to Get the Field Value from. 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 retrieve the Value from.

Optional Parameters
FMRecID

The Internal FileMaker Record ID of the Record to Get the Field Value from.

SkipTONameCheck

If True, CNS Query will not check to make sure the TO Name you specified actually exists before retrieving the Field Value.

SkipFieldNameCheck

If True, CNS Query will not check to make sure the Field Name you specified actually exists before retrieving the Field Value.

SkipFMRecIDCheck

If True, CNS Query will not check to make sure the Record ID you specified actually exists before retrieving the Field Value.

Examples
Example 1

This would retrieve the Value of the "AField" Field from the "MyTable" Table from the Record with the ID 4.

CNSQuery_GetFieldValueByID( "MyTable" ; "AField" ; 4 )
Example 2

This would retrieve the Value of the "FirstName" Field from the current Table from the current Record.

CNSQuery_GetFieldValueByFind( "" ; "FirstName" )
Example 3

In FileMaker Pro 11 and above, use this form to get the Field Value from a Table Occurrence in a separate, open Database file.

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