?
Solved

show 'X' amount of records from a related set

Posted on 2009-04-14
3
Medium Priority
?
958 Views
Last Modified: 2012-08-14
How do you show only the first 'X' amount of records from a related set on the web using filemaker API PHP?

I have 20 records in the related set, however I only want to display the last 5 records. On my filemaker web layout the related set portal is set to view only 5, with scroll bar inactive.

Currently the web outputs all 20 records in the related set.
Using function: 
 
$relatedset = $xxx->getRelatedSet("TABLE");
 
<? foreach ($relatedset as $record) {
 
echo $record->getField("TABLE::name_item");
 
} ?>

Open in new window

0
Comment
Question by:sam_thwaites
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 28

Expert Comment

by:lesouef
ID: 24148527
break the loop when you reach 5 records?
0
 

Author Comment

by:sam_thwaites
ID: 24149276
I'm not sure how to break a loop, can u please show me some example code. Thanks lesouef
0
 
LVL 28

Accepted Solution

by:
lesouef earned 1000 total points
ID: 24149460
you need to count the records for instance:

$count = 0 ;
<? foreach ($relatedset as $record) {
 echo $record->getField("TABLE::name_item");
      $count++ ;
      if ($count == 5) break ;
} ?>
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question