Product Logo

CNS Query

Query your databases without relationships.

Functions

CNSQuery_SetFieldValueByID

NameCNSQuery_SetFieldValueByID
Description

This function Sets the Value of a single Field in a Record with a specific ID. The first parameter is the Name of a Table Occurrence of the Table to Set The Field Value in. If you do not specify this parameter, CNS Query will use Get(LayoutTableName) to get the Current Layout TO to Set the Field Value in. The second parameter is the Name of the Field to Set. The third parameter is the new Value for the Field. The fourth parameter is the Internal FileMaker Record ID of the Record to Set the Field Value in. 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 Set 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 fifth, sixth, and seventh parameters.

Return TypeText
FormatCNSQuery_SetFieldValueByID ( TOName ; FieldName ; FieldValue ; FMRecID ; SkipTONameCheck ; SkipFieldNameCheck ; SkipFMRecIDCheck )
Required Parameters
TOName

The Name of a Table Occurrence of the Table to Set the Field Value in. 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 Set.

FieldValue

The new Value for the Field.

Optional Parameters
FMRecID

The Internal FileMaker Record ID of the Record to Set the Field Value in.

SkipTONameCheck

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

SkipFieldNameCheck

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

SkipFMRecIDCheck

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

Examples
Example 1

This would Set the Value of the "AField" Field in the "MyTable" Table" with the Record with ID 4 to the Value "some new value".

CNSQuery_SetFieldValueByID( "MyTable" ; "AField" ; "some new value" ; 4 )
Example 2

This would Set the Value of the "FirstName" Field of the current Record in the current Table to the Value "Maryanne".

CNSQuery_SetFieldValueByID( "" ; "FirstName" ; "Maryanne" )
Example 3

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

CNSQuery_SetFieldValueByID( "AnotherFile.MyTable" ; "AField" ; "some new value" ; 4 )