Hi Chris,
I think I’m really close, but I’m missing something and could use some of your words of wisdom.
Here’s what I did.
I set up a multirecord editor called venue_address_book with fields like venue_name, venue_address, venue_contact_e_mail, venue_phone, etc.
Then I set up a multirecord editor called eblast_events_notice with a number of event related fields and one list field called "venue".
The field has the following parameters:
Field Label: Venue
Field Name: venue
Field Type: list
Field Options:
Display As: checkboxes (multi value)
List Options: Get options from database (advanced)
Section Tablename: venue_address_book
Use this field for option values: num
Use this field for option labels: venue_name
I uploaded and activated the later version of the Related Record Lookup Functions Plugin
I populated the venue_address_book with a few records and selected (checked) one in a record in the eblast_events_notice table.
Then I set up a detail viewer with the following get records code at the top.
<?php
require_once "/hsphere/local/home/apbcweb/artistsofpalmbeachcounty.org/cmsAdmin/lib/viewer_functions.php";
list($e_blast_events_noticeRecords, $e_blast_events_noticeMetaData) = getRecords(array(
'tableName' => 'e_blast_events_notice',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$e_blast_events_noticeRecord = @$e_blast_events_noticeRecords[0]; // get first record
list($venue_address_bookRecords, $venue_address_bookMetaData) = getRecords(array(
'tableName' => 'venue_address_book',
));
beta_lookupRelatedFields(array(
'table' => 'venue_address_book',
'recordList' => &$venue_address_bookRecords,
'fieldList' => array( 'venue_name' )
));
// show error message if no matching record is found
if (!$e_blast_events_noticeRecord) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}
?>
And this code in the body:
<?php if (empty($venue_address_bookRecord['venue_name'])): ?>
No Venue Information.
<?php else: ?>
Venue Information:
<ul>
<li>
<?php echo $venue_address_bookRecord['venue_name'] ?>
<?php echo $venue_address_bookRecord['venue_contact_e_mail'] ?>
<?php echo $venue_address_bookRecord['venue_phone'] ?>
</li>
</ul>
<?php endif ?>
When I try to bring up that record’s detail page a browser, I get the following error:
lookupRelatedFields: field 'venue_name' is not set to 'Get options from database (advanced)'
Thanks,
Jerry Kornbluth
The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php