Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

FM.InsertOrUpdateRecord3

Inserts or updates a record in a table in one line.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
FM FMSQL 6.1 Yes Yes Yes Yes Yes

MBS( "FM.InsertOrUpdateRecord3"; FileName; TableName; IDField1; IDValue1; IDField2; IDValue2; IDField3; IDValue3; FieldName; FieldValue )

Parameters

Parameter Description Example value
FileName The file name of where the table is inside. Can be empty to look for the table in all files. Get(FileName)
TableName The name of the table to insert record into. "Assets"
IDField1 The name of the field which provides an unique ID for each record, so we can identify the field. "ID1"
IDValue1 The value for the ID field to identify the record.
Data type of parameter must match the data type of the field.
$RecordID
IDField2 The name of the field which provides an unique ID for each record, so we can identify the field. "ID2"
IDValue2 The value for the ID field to identify the record.
Data type of parameter must match the data type of the field.
$RelatedRecordID
IDField3 The name of the field which provides an unique ID for each record, so we can identify the field. "ID3"
IDValue3 The value for the ID field to identify the record.
Data type of parameter must match the data type of the field.
$OtherRecordID
FieldName A field name to set. "Model"
FieldValue A field value to use for setting the field in the parameter before.
Data type of parameter must match the data type of the field.
"Test"

Result

Returns OK or error.

Description

Inserts or updates a record in a table in one line.
Same as FM.InsertOrUpdateRecord, but with 3 ID fields to locate record.
If the insert fails due to duplicate ID, we will update the record values.
You pass to this function table name (and optional filename).
To identify the record you pass the name of the ID field and the value for the record. The ID field must be unique.
Than you pass one pair of field name and value for each field you like to set in the new record.

This function combines FM.InsertRecord and FM.UpdateRecord. If the ID is already used, we update, else we insert a new record.
With plugin version 7.2 or later, you can specify fields and table via IDs and the plugin will lookup them for you at runtime. Table IDs and table names must be unique across all open files for this to work correctly.

Examples

Insert a record:

MBS( "FM.InsertOrUpdateRecord3"; ""; "Kontakte"; "Vorname"; "Christian"; "Nachname"; "Schmitz"; "Firma"; "MBS"; "Titel"; "Herr" )

See also


FM.InsertOrUpdateRecord2   -   FM.InsertRecord

Feedback: Report problem or ask question.




Links
MBS FileMaker tutorial videos