|Mac & Win
Inserts a new record in a table in one line.
|The file name of where the table is inside. Can be empty to look for the table in all files.
Using a table in another database file may require you adding the other file as an external data source and adding the external table to your relationship graph to grant access.
|The name of the table to insert record into.
Can be ID of table, so we lookup name by ID.
Can be result of GetFieldName() function as we remove field name automatically.
|A field name to set.
Can be ID of field, so we lookup name by ID.
Can be result of GetFieldName() function as we remove table name automatically.
|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.
Returns OK or error.
DescriptionInserts a new record in a table in one line.
You pass to this function table name (and optional filename).
Then you pass one pair of field name and value for each field you like to set in the new record.
As we can't know the new ID assigned for the record, you can help yourself by passing in an UUID for a field and later select that to get the auto assigned primary key (or have the UUID be the primary key, so you don't need a query).
See also FM.UpdateRecord to insert new record and FM.InsertOrUpdateRecord to update or insert 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.
You can use FM.ExecuteSQL.LastSQL function to see later what SQL was created and run.
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.
Please repeat FieldName and FieldValue parameters as often as you need.
Insert a record into Assets table:
Insert a record with 5 fields:
Insert with table and field ID instead of names:
Insert with using GetFieldName for field names:
Build dynamically the evaluate statement with parameters:
Insert with automatic table name:
CountScriptCall custom function:
LogFunctionCall custom function:
LogFunctionResult custom function:
- Version 12.4
- Version 11.2
- Version 10.1
- Version 9.3
- Rewrote FM.InsertRecordCSV to support multi line values.
- Version 9.2
- Fixed problem with delimiter detection in FM.InsertRecordCSV.
- Version 8.5
- Version 8.4
- Changed FM.InsertRecord and other SQL based functions to process field names and remove field name postfix with :: in table names and remove table prefix with :: in Field names.
- Version 8.2
- Version 8.0
- MongoDB/MongoDB Audit
- SQL in FileMaker/Custom Functions to Log Scriptcalls
- SQL in FileMaker/SQL Select Container
- Watch MongoDB Database
- New records without layout change in FileMaker
- MBS @ FMTraining.TV
- Sending email with a huge custom function
- Combined Components with MBS FileMaker Plugin
- Watching for Errors with MBS Plugin
- Custom Functions to Log Script Calls and maintain call stack
- Looping over records in FileMaker with error checking
- Dynamically build MBS call and evaluate it
- MBS FileMaker Plugin 5.1 for OS X/Windows
This function checks for a license.
Created 24th April 2015, last changed 21st August 2023