November 18, 200817 yr hello.. so, i'm making my way (stumbling through) using the Filemaker API.. and i'd like to clarify something in my head before i get to used to the idea, in case it's the 'wrong' way. I thought i could get a related field from the "Meeting" table field by doing: define ('FM_HOST', '127.0.0.1'); define ('FM_FILE', 'rxworldwide'); define ('FM_USER', '******'); define ('FM_PASS', '******'); include ('Filemaker.php'); ###### CONNECT TO DATABASE $fm = new FileMaker (FM_FILE, FM_HOST, FM_USER, FM_PASS); ###### GET ATTENDEE RECORD $attendee = $fm->getRecordById('Attendee Setup', NULL); // i'll fix the null thing later ##### GET MEETING RECORD $meeting = $fm->getRecordById('Meeting Setup', NULL); // ditto Originally, i had a "Web" layout containing fields from both the Attendee table and related fields from the Meeting table.. but i couldn't get the related fields to appear on the web. Now, to pull an attendee field.. i just: <?php echo $attendee->getField('attendee name') ?> And to get a meeting field on the same page.. i'm doing: <?php echo $meeting->getField('meeting name') ?> It's working this way (above), but i wanted to make sure i wasn't developing any bad habits right out of the gate. <?php echo $attendee->getField('Meeting::meeting name') ?> no dice.. i don't know if it's not /supposed/ to work that way, or if i'm just thinking about this all wrong(?). any guidance would be greatly appreciated. :)
November 19, 200817 yr see my other post . The short of it is that a you need to use the 'relationship name' i.e. the name of the Table Reference in FMP's relationship graph which my not be the same as the Table name. Also if your related table is in a portal you will need to grab the related set before you can access the fields. (even if the portal just contains one row.) $relatedRecords = getRelatedSet('relationship_name'); Will return an array of Filemaker_Record Objects that you can loop through and grab fields from; Edited November 19, 200817 yr by Guest
Create an account or sign in to comment