Skip to content

Commit 11130ea

Browse files
author
David Nahodyl
committed
updated doc with createRecord and post-edit script example
1 parent 048df3d commit 11130ea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ findByRecordId
194194
performScript
195195
setContainer
196196
duplicate
197+
createRecord
197198
```
198199

199200
#### Examples:
@@ -228,6 +229,12 @@ Perform a script on a database other than the default database connection
228229
$result = FM::connection('MyOtherDatabaseConnectionName')->layout('MyLayoutName')->performScript('MyScriptName');
229230
```
230231

232+
Create a record with an array of field data and then perform a script after record creation, within the same request
233+
```
234+
FM::layout('MyLayoutName')->script('ScriptName')->fieldData($data)->createRecord();
235+
236+
```
237+
231238

232239
## Relating Native Laravel models to FMModels
233240
It is possible to have relationships between native Laravel Model objects from your MySQL database and FMModels created from your FileMaker database. To do this, you will need to set up both connections in your `database.config` file and then make sure your models are pointing to the right connection by setting the `$connection` propety in your Model and FMModel classes.

0 commit comments

Comments
 (0)