Product Logo

CNS Query

Query your databases without relationships.

Functions

CNSQuery_UpdateRecordByID

NameCNSQuery_UpdateRecordByID
Description

This function Updates a Record in a Table Occurrence using its Internal FileMaker Record ID. The first parameter is the Name of a Table Occurrence of the Table to Update the Record in. If you do not specify this parameter, CNS Query will use Get(LayoutTableName) to get the Current Layout Table to Update the Record in. The second parameter is the Internal FileMaker Record ID of the Record you want to Update. The third parameter is a return- or paragraph mark-separated list of “FieldName=FieldValue” pairs describing the Field Values to Update the Record with. If a Field Value needs a return in it, you can use “<CR>” to indicate a return. By default, CNS Query will check to make sure the TO Name, the Record ID, and the Field Names you specify exist before attempting to Update the Record. If you already know for sure that the TO Name, the Record ID, and the Field Names exist, you can pass True as the fourth, fifth, and sixth parameters.

Return TypeText
FormatCNSQuery_UpdateRecordByID ( TOName ; FMRecID ; FieldValues ; SkipTONameCheck ; SkipFMRecIDCheck ; SkipFieldNameChecks )
Required Parameters
TOName

The Name of the Table Occurrence that contains the Record you want to Update. 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”.

FMRecID

The Internal FileMaker Record ID of the Record to Update.

FieldValues

A return- or paragraph mark-separated list of “FieldName=FieldValue” pairs describing the new Field Values to Update the Record with. Use “<CR>” to indicate a return or new line in a Field Value.

Optional Parameters
SkipTONameCheck

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

SkipFMRecIDCheck

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

SkipFieldNameChecks

If True, CNS Query will not check to make sure the Field Names you specified actually exist before Updating the Record.

Examples
Example 1

Updates the Record with the ID 2 in the "MyTable" Table, setting the "BField" Field to "some new value" and the "CField" Field to "some other value".

CNSQuery_UpdateRecordByID( "MyTable" ; 2 ; "BField=some new value¶CField=some other value" )
Example 2

Updates the Record with ID 4 in the current Table, setting the "Description" field with a multi-line value.

CNSQuery_UpdateRecordByID( "" ; 4 ; "Description=some<CR>value<CR>with<CR>multiple<CR>lines" )
Example 3

In FileMaker Pro 11 and above, use this form to Update a Record in a Table Occurrence in a separate, open Database file.

CNSQuery_UpdateRecordByID( "AnotherFile.MyTable" ; 4 ; "BField=some new value" )