You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+11-1
Original file line number
Diff line number
Diff line change
@@ -271,14 +271,24 @@ The Data API lets you set a [Modification ID](https://help.claris.com/en/data-ap
271
271
272
272
> Specifying a modification ID ensures that you are editing the current version of a record. If the modification ID value does not match the current modification ID value in the database, the record is not changed.
273
273
274
-
If you wish to include the modId when editing a record you can call `withModId()` before calling `save()` on the model object. This will send the ModID to FileMaker when updating the record, and will throw a `FileMakerDataApiException` if the ModId does not match.
274
+
If you wish to include the modId when editing a record you can call `withModId()` before calling `save()` on the model object. This will send the ModID to FileMaker when updating the record, and will throw a `FileMakerDataApiException` with code `306` if the ModId does not match.
275
275
276
276
```php
277
277
$person->withModId()->save();
278
278
```
279
279
280
280
The modId is automatically set on the model object when you retrieve a record from FileMaker, so you don't need to set it manually.
281
281
282
+
If you want to set the ModId manually you can do so by either passing the modId into `withModId($myModId)` or calling `setModId($myModId)` on the model object.
283
+
284
+
285
+
```php
286
+
287
+
// set the ModId and flag it submit the modification ID when saving the record
288
+
$person->withModId(12)->save();
289
+
290
+
```
291
+
282
292
If you always want the ModId to be included when saving a record, you can set the `$withModId` property to true on your model class.
0 commit comments