Product Logo

CNS Query

Query your databases without relationships.

Functions

CNSQuery_RemoveRecordByFind

NameCNSQuery_RemoveRecordByFind
Description

This function Removes one or more Records based on a Find Criteria. The first parameter is the Name of a Table Occurrence for the Table to Remove the Record from. If you do not specify this parameter, CNS Query will use Get(LayoutTableName) to get the Current Layout TO to Remove the Record from. The second parameter is a return- or paragraph mark-separated list of “FieldName=FieldValue” pairs that describes the Criteria for Finding the Record or Records to Remove. See the “Finding What You Want” section in the CNSQuery_FindRecords function for help in defining your Find Criteria. By default, CNS Query will only Remove the first Record it finds. If you want to Remove all Records that match the Find Criteria, specify True as the third parameter. By default, CNS Query will check to make sure the TO Name and the Field Names you specify exist before attempting to Remove the Record. If you already know for sure that the TO Name and the Field Names exist, you can pass True as the fourth and fifth parameters. By default, CNS Query will double-check to make sure the Record or Records were actually removed. If you would rather the plug-in skip this step, specify True as the sixth parameter. Finally, if you want the Find to be Case Sensitive, you can specify True as the last parameter.

Return TypeText
FormatCNSQuery_RemoveRecordByFind ( TOName ; FindCriteria ; RemoveAllMatches ; SkipTONameCheck ; SkipFieldNameChecks ; SkipConfirmRemoval ; CaseSensitive )
Required Parameters
TOName

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

FindCriteria

A return- or paragraph mark-separated list of “FieldName=FieldValue” pairs describing the Criteria for Finding the Record to Remove. See the “Finding What You Want” section of the CNSQuery_FindRecords function for help in setting up the Find Criteria.

Optional Parameters
RemoveAllMatches

If True, CNS Query will Remove all Records that match the Find Criteria. Default is False.

SkipTONameCheck

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

SkipFieldNameChecks

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

SkipConfirmRemoval

If True, CNS Query will not double-check to make sure the Record was Removed.

CaseSensitive

If True, CNS Query will preserve the Case in the Field Values of the Find Criteria. (In other words, if CaseSensitive is True, “Green” would not match “green”.)

Examples
Example 1

This would Remove the first Record in the "MyTable" Table where the "AField" Field had the value "some value".

CNSQuery_RemoveRecordByFind( "MyTable" ; "AField=some value" )
Example 2

This would Remove all Records in the current Table where the Values of the "LastName" field started with a "J".

CNSQuery_RemoveRecordByFind( "" ; "::Begins-With::LastName=J" ; True )
Example 3

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

CNSQuery_RemoveRecordByFind( "AnotherFile.MyTable" ; "AField=some value" )