sfmoore2000

Retrieving Related Records using FileMaker_Implementation::getfield() method

Discussion created by sfmoore2000 on Jan 2, 2013

The code surrounding getfield() was working fine last week and I am unsure if something has changed. In red below is the code that I am receiving the problem with and here is the web error:

 

Fatal error: Call to undefined method FileMaker_Implementation::getfield() on line 67

 

I checked the Filemaker_Method and it seems the same....Any help would be appreciated......

 

Thanks

 

 


<?php

include('dbaccess.php');

?>

 

<!--Get the record using the id value passed in the URL.

 

This will be utilized to pull the data from the main record.-->

 

<?php

$record =$fm->getRecordByID("TestData", $_GET['id']);?>

 

<!--Now display the parent record in HTML-->

 

<table border="1">

<tr>

<td><?php echo $record->getField("Name");?></td>

</tr>

<tr>

<td><?php echo $record->getField("Address");?></td>

</tr>

<tr>

<td><?php echo $record->getField("City");?></td>

</tr>

<tr>

<td><?php echo $record->getField("State");?></td>

</tr>

<tr>

<td><?php echo $record->getField("ZipCode");?></td>

</tr>

<tr>

<td><?php echo $record->getField("Id");?></td>

</tr>

<tr>

<td><?php echo $record->getField("EmailAddress");?></td>

</tr>

<tr>

<td><?php echo $record->getField("DOB");?></td>

</tr>

</table>

 

 

<?php

 

 

$related_records = $record->getRelatedSet('Contacts');

 

 

echo '<table border="1">

<tr>

<th>First Name</th>

<th>Last Name</th>

<th>ContactID</th>

<th>Relationship</th>

</tr>';

 

foreach ($related_records as $related_record) {

echo '<tr>';

echo '<td>' . $related_record->getfield('Contacts::FirstName') .'</td>';

echo'<td>' . $related_record->getField('Contacts::LastName') .'</td>';

echo '<td>' . $related_record->getField('Contacts::__Contact_Id') .'</td>';

echo '<td>' . $related_record->getField('Contacts::RelationShip_Type') .'</td>';

 

 

echo'</tr>';

}

echo '</table>';

 

 

?>

Outcomes