MMQuery

Query your databases without relationships.

<- Back to MMQuery function list

MMQuery_SetFieldValueByFind

Description

This function Sets the Value of a single Field using Find Criteria. 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, MMQuery 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 a return- or paragraph mark-separated list of "FieldName=FieldValue" pairs that describes the Criteria for Finding the Record to Set the Field Value in. See the "Finding What You Want" section in the MMQuery_FindRecords function for help in defining your Find Criteria. By default, MMQuery will check to make sure the TO Name and all the Field Names you specify exist before attempting to Set the Field Value. If you already know for sure that the TO Name and the Field Names exist, you can pass True as the fifth and sixth parameters. Finally, if you want the Find to be Case Sensitive, you can specify True as the last parameter.

Return Type
Text
Format
MMQuery_SetFieldValueByFind ( TOName ; FieldName ; FieldValue ; FindCriteria ; SkipTONameCheck ; SkipFieldNameChecks ; CaseSensitive )
Required Parameters
  • TOName

    The Name of the Table Occurrence 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.

  • FindCriteria

    A return- or paragraph mark-separated list of "FieldName=FieldValue" pairs describing the Criteria for Finding the Record to Set the Field Value in. See the "Finding What You Want" section of the MMQuery_FindRecords function for help in setting up the Find Criteria.

Optional Parameters
  • SkipTONameCheck

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

  • SkipFieldNameChecks

    If True, MMQuery will not check to make sure all the Field Names in the variaous parameters actually exist before Setting the Field Value.

  • CaseSensitive

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

Related Items
MMQuery_AddField, MMQuery_FieldExists, MMQuery_FindRecords, MMQuery_GetFieldIDs, MMQuery_GetFieldNames, MMQuery_GetFieldTypes, MMQuery_GetFieldValueByFind, MMQuery_GetFieldValueByID, MMQuery_RemoveField, MMQuery_SetFieldValueByID
Examples

Example 1

Code:

MMQuery_SetFieldValueByFind("MyTable";"BField";"A New Value";"AField=some value")

Result:

This would Set the Value of the "BField" Field to "A New Value" in the "MyTable" Table for the first Record where the "AField" Field has the Value "some value".

Example 2

Code:

MMQuery_SetFieldValueByFind("";"LastName";"Jones";"FirstName=Ann")

Result:

This would Set the Value of the "LastName" Field to "Jones" in the current Table for the first Record where the "FirstName" Field has the Value "Ann".

Example 3

Code:

MMQuery_SetFieldValueByFind("AnotherFile.MyTable";"BField";"A New Value";"AField=some value")

Result:

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