I am using the PHP API to insert records in FileMaker. I also need to insert related data into a separate table, so I need to pull the record ID from the new record that gets created so that I can include that ID in the new record for the related table.

Here is what I'm working with:

```
$fm =  new FileMaker('PayPal_IPN', FM_HOST, FM_USER, FM_PASS);
$new_ipn_record = $fm->createRecord('ipn_transactions', $ipn_record_data);
$new_ipn_record_result = $new_ipn_record->commit();

```

That part works as expected and adds the new record into FileMaker. So now I need to get the ID of the record that was just created. I tried this...

```
$new_ipn_record_id = $new_ipn_record_result->getLastRecord()->getRecordID();

```

But I end up with an error...

> 
> Call to a member function getLastRecord() on a non-object
> 
> 
> 

Any information on what I'm doing wrong here would be greatly appreciated. Thanks!