Hi, Everyone. I've searched the forum extensively, but haven't found anything for this scenario and hope someone can guide me to a solution.
----------------------------------
TABLES:
// list of moorings
list($mooringsRecords, $mooringsMetaData) = getRecords(array(
'tableName' => 'moorings',
'allowSearch' => false,
));
// list of inspections records
list($inspectionsRecords, $inspectionsMetaData) = getRecords(array(
'tableName' => 'inspections',
'allowSearch' => false,
));
----------------------------------
DESIRED HTML OUTPUT on the Moorings List Viewer page:
<?php foreach ($mooringsRecords as $record): ?>
(the usual records for $mooringsRecords)
+ most recent ['inspection_date'] field from $inspectionsRecords that matches this moorings record number
<?php endforeach ?>
----------------------------------
The $inspections ["mooring_number"] field editor setup:
Field Options - Display as pulldown
Get options from database (advanced)
Section Tablename = moorings
Field for option values = num
Field for option labels = num
Each mooring can have multiple ["inspection_date"]s, but we only want to display the most recent date for each mooring.
----------------------------------
Hope I explained that well enough. Thanks for any help you can give!
~ Deborah