MMQuery_AddRecord
- Description
This function Adds a new Record to an existing Table. The first parameter is the Name of a Table Occurrence of the Table to receive the new Record. If you do not specify this parameter, MMQuery will use Get(LayoutTableName) to get the current Table and Add the Record to that Table. The second parameter is a return- or paragraph mark-separated list of "FieldName=FieldValue" pairs describing the Field Values for the new Record. If a Field Value needs a return in it, you can use "<CR>" to indicate the return. By default, MMQuery will check to make sure the Table Name and all the Field Names you specify exist before attempting to Add the new Record. If you already know for sure that the Table Name and the Field Names exist, you can pass True as the third and fourth parameters.
- Return Type
- Text
- Format
- MMQuery_AddRecord ( TOName ; FieldValues ; SkipTONameCheck ; SkipFieldNameChecks )
- Required Parameters
- TOName
The Name of a Table Occurrence for the Table to receive the new Record. 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".
- FieldValues
A return- or paragraph mark-separated list of "FieldName=FieldValue" pairs describing the Field Values for the new Record. Use "
" to indicate a return or new line in a Field Value.
- TOName
- Optional Parameters
- SkipTONameCheck
If True, MMQuery will not check to make sure the TO Name you specified actually exists before attempting to Add the Record.
- SkipFieldNameChecks
If True, MMQuery will not check to make sure all the Field Names in the FieldValues parameter actually exist before attempting to Add the Record.
- SkipTONameCheck
- Related Items
- MMQuery_FindRecords, MMQuery_RemoveRecordByFind, MMQuery_RemoveRecordByID, MMQuery_UpdateRecordByFind, MMQuery_UpdateRecordByID
- Examples
Example 1
Code:
MMQuery_AddRecord("MyTable";"MyField=Some value¶AnotherField=Some other value")Result:
Adds a new Record to the "MyTable" Table setting the "MyField" and "AnotherField" Fields.Example 2
Code:
MMQuery_AddRecord("";"MyField=A<CR>value<CR>with<CR>multiple<CR>lines")Result:
Adds a new Record to the current Table setting the "MyField" field with a multi-line value.Example 3
Code:
MMQuery_AddRecord("AnotherFile.MyTable";"MyField=Some value")Result:
In FileMaker Pro 11 and above, use this form to add a new Record to a Table Occurrence in a separate, open Database file.