<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>FileMaker Weetbix</title>
	<atom:link href="http://filemakerweetbix.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://filemakerweetbix.wordpress.com</link>
	<description>breakfast of champions.</description>
	<lastBuildDate>Mon, 28 Sep 2009 02:45:16 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='filemakerweetbix.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/1b7bbf36f2beddb914ebeed2ced84251?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>FileMaker Weetbix</title>
		<link>http://filemakerweetbix.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://filemakerweetbix.wordpress.com/osd.xml" title="FileMaker Weetbix" />
		<item>
		<title>DevCon 2009</title>
		<link>http://filemakerweetbix.wordpress.com/2009/08/20/devcon-2009/</link>
		<comments>http://filemakerweetbix.wordpress.com/2009/08/20/devcon-2009/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 09:26:43 +0000</pubDate>
		<dc:creator>filemakerweetbix</dc:creator>
				<category><![CDATA[Non Article]]></category>
		<category><![CDATA[Devcon]]></category>
		<category><![CDATA[Developer Conference]]></category>
		<category><![CDATA[Photos]]></category>

		<guid isPermaLink="false">http://filemakerweetbix.wordpress.com/?p=103</guid>
		<description><![CDATA[Well if you are wondering where the new articles are, I can tell you that they&#8217;re coming very soon.  The last couple of months has been hectic leading up to Devcon 2009.  I also took 2 weeks off before devcon to do some cycling in Oregon &#38; California.  Devcon was a great [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=103&subd=filemakerweetbix&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Well if you are wondering where the new articles are, I can tell you that they&#8217;re coming very soon.  The last couple of months has been hectic leading up to Devcon 2009.  I also took 2 weeks off before devcon to do some cycling in Oregon &amp; California.  Devcon was a great experience.  Here are some early pics, more to come soon…</p>
<p><span id="more-103"></span></p>
<p><img src="http://farm3.static.flickr.com/2435/3839560532_7347e1e320.jpg" alt="Setting up our Reactor stand" /></p>
<p><img src="http://farm4.static.flickr.com/3536/3838770197_9d66b6fa38.jpg" alt="Our Reactor stand" /></p>
<p><img src="http://farm3.static.flickr.com/2490/3839559172_b9ac8e4b55.jpg" alt="Julie and I at the stand" /></p>
<p><img src="http://farm4.static.flickr.com/3520/3838768999_227dd9ff8f.jpg" alt="Getting the banner ready." /></p>
<p><img src="http://farm3.static.flickr.com/2608/3839556140_3689c8868f.jpg" alt="The team posting after Craig picks up a Mad Dog award for contributions to the community.  From left:  Craig, Julie, Jules, Sam, Me" /></p>
<p>More pics from during Devcon soon…</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/filemakerweetbix.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/filemakerweetbix.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/filemakerweetbix.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/filemakerweetbix.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/filemakerweetbix.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/filemakerweetbix.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/filemakerweetbix.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/filemakerweetbix.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/filemakerweetbix.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/filemakerweetbix.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=103&subd=filemakerweetbix&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://filemakerweetbix.wordpress.com/2009/08/20/devcon-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8f1688e44d66b075196f05c9a1580dc6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">filemakerweetbix</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2435/3839560532_7347e1e320.jpg" medium="image">
			<media:title type="html">Setting up our Reactor stand</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3536/3838770197_9d66b6fa38.jpg" medium="image">
			<media:title type="html">Our Reactor stand</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2490/3839559172_b9ac8e4b55.jpg" medium="image">
			<media:title type="html">Julie and I at the stand</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3520/3838768999_227dd9ff8f.jpg" medium="image">
			<media:title type="html">Getting the banner ready.</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2608/3839556140_3689c8868f.jpg" medium="image">
			<media:title type="html">The team posting after Craig picks up a Mad Dog award for contributions to the community.  From left:  Craig, Julie, Jules, Sam, Me</media:title>
		</media:content>
	</item>
		<item>
		<title>Building a Tidy Database &#8211; An Overview</title>
		<link>http://filemakerweetbix.wordpress.com/2009/06/22/maintaining-a-tidy-database-an-overview/</link>
		<comments>http://filemakerweetbix.wordpress.com/2009/06/22/maintaining-a-tidy-database-an-overview/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 09:15:14 +0000</pubDate>
		<dc:creator>filemakerweetbix</dc:creator>
				<category><![CDATA[Database Design]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[Naming Conventions]]></category>
		<category><![CDATA[Schema]]></category>
		<category><![CDATA[Tidy]]></category>

		<guid isPermaLink="false">http://filemakerweetbix.wordpress.com/?p=99</guid>
		<description><![CDATA[In this new series of articles, I am going to explain all the methods I use to help maintain a tidy and manageable database.  As the size of a database grows, it can be very easy to fall into complacency, and become slack in areas such as naming conventions.  I will give some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=99&subd=filemakerweetbix&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In this new series of articles, I am going to explain all the methods I use to help maintain a tidy and manageable database.  As the size of a database grows, it can be very easy to fall into complacency, and become slack in areas such as naming conventions.  I will give some tips on how to avoid this and keep your database spick and span <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-99"></span></p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Why a Tidy Database?</span></p>
<p>Keeping your database tidy has huge benefits over the entire life cycle of the system.  If you are building a database for the first time, or for a personal project, then you might think this is not important.  Indeed, while you are in the development phase, you are &#8220;in the moment&#8221; &#8211; you know where everything goes, how everything works, and why everything is the way it is.  Only later on down the track will it become apparent to you why you should have started keeping things tidy from the beginning.  You might think you&#8217;ll never forget how your database works, but I guarantee that if you leave it for 6 months, it will feel like someone else built it when you return to do more development!   The problem is people are continually learning,  continually coming up with new ways to do things in FileMaker.  The way you build a database 6 months from now may be completely different from the way you build a database now.</p>
<p>For this reason, it is important that you devise some simple conventions you can follow in the development of your database.  If you maintain this consistency through your databases, then it becomes much easier to return to a database after a period of time, and be able to understand how it works.</p>
<p>For a developer, this is even more important.  If you have multiple developers working on a project, then ensuring everyone is on the same wavelength when it comes to conventions is one of the most important things you should make sure of.  Failing to do so usually results in everybody bringing their own ideas to the database,  and the whole thing ends up in a mixture of conventions.</p>
<p>Most importantly,  maintaining a tidy database is a great habit to get into.  If you start early, and force yourself to stick to conventions, then you are well on your way to becoming a great developer!</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">What is a &#8220;Tidy&#8221; Database?</span></p>
<p>One of the biggest things that a tidy database contains is consistency.  The term consistency encompasses a broad range of areas of the database, some examples are:</p>
<li>Consistency in naming conventions for tables, fields, table occurrences etc…</li>
<li>Consistency in layout design elements, ie fields, labels, portals all built to a similar standard.</li>
<li>Consistency in calculation design and scripting, ie commenting, spacing, common actions..</li>
<p>Now,  being consistent does not necessarily mean being tidy.  You can still have a database with consistently bad naming conventions!   The goal is to find good naming conventions, and standards that you can understand and feel are easy to understand, and then stick with them!   It&#8217;s no good switching your conventions halfway through development of a database unless you are prepared to change the conventions everywhere within the database.</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">What&#8217;s to come?</span></p>
<p>Within the coming weeks and months I will be writing articles (in order) on the following topics for this series:</p>
<li>Anchor-Buoy: An alternate approach to the relationship graph</li>
<li>Naming Conventions and good Practice: Database Schema</li>
<li>Naming Conventions and good Practice: Scripts</li>
<li>Naming Conventions and good Practice: Value Lists and Custom Functions</li>
<li>Consistency in Design:  Building Layouts</li>
<li>Plus anything else that might crop up.</li>
<p>You may be asking yourself what Anchor-Buoy is.  Well in a nutshell it is a design methodology for how to structure your relationship graph efficiently.  Most beginners to FileMaker start with a few tables, and some table occurrences on their graph to match the tables.  They will create some basic relationships between the table occurrences, but generally won&#8217;t go beyond a certain level.  If the database ever begins to grow in size and complexity,  they might become overwhelmed with the number of relationships and table occurrences on the graph, and more often than not, the graph evolves into a classic &#8220;spiderweb&#8221; structure, with everything related to everything else, one big mess!</p>
<p>Anchor-Buoy breaks the cycle of the spiderweb graph.  Hopefully I can do it justice and explain it sufficiently, because I believe it to be the single most significant thing you can use to help keep your database tidy and manageable going forward.</p>
<p>With Anchor-Buoy explained, I will move onto discuss the naming conventions I use for table and field names, and also the naming of table occurrences on the graph.  How my table occurrences get their names is specific to having an anchor-buoy structure, which is why I must explain that first.</p>
<p>Next, I will go over some of the ways in which I keep scripts well organized.  You might not think it necessary, but alot of larger FileMaker solutions contain over 500 scripts, so it pays to know how to locate them.  I will also talk about some things you can do within your scripts to keep them tidy and more readable.</p>
<p>Then I will talk about some other conventions that apply to more specific areas, such as value lists and custom functions.  While perhaps not quite as important as other naming conventions, that is no excuse not to slack off when naming them!</p>
<p>Finally, I&#8217;ll explain and demonstrate the importance of consistency when it comes to designing and building your layouts.</p>
<p>Stay tuned for more soon!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/filemakerweetbix.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/filemakerweetbix.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/filemakerweetbix.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/filemakerweetbix.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/filemakerweetbix.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/filemakerweetbix.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/filemakerweetbix.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/filemakerweetbix.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/filemakerweetbix.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/filemakerweetbix.wordpress.com/99/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=99&subd=filemakerweetbix&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://filemakerweetbix.wordpress.com/2009/06/22/maintaining-a-tidy-database-an-overview/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8f1688e44d66b075196f05c9a1580dc6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">filemakerweetbix</media:title>
		</media:content>
	</item>
		<item>
		<title>Join my Table? &#8211; Part Three</title>
		<link>http://filemakerweetbix.wordpress.com/2009/06/20/join-my-table-part-three/</link>
		<comments>http://filemakerweetbix.wordpress.com/2009/06/20/join-my-table-part-three/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 02:46:45 +0000</pubDate>
		<dc:creator>filemakerweetbix</dc:creator>
				<category><![CDATA[Database Design]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[Join Table]]></category>
		<category><![CDATA[Schema]]></category>
		<category><![CDATA[Table]]></category>

		<guid isPermaLink="false">http://filemakerweetbix.wordpress.com/?p=82</guid>
		<description><![CDATA[In Part Two, I demonstrated how to implement the basics of the join table solution in FileMaker.  While the solution works fine as an illustration for join tables, it lacked many of the basic interface features that would make it a usable solution.  In part three, I will show how to implement some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=82&subd=filemakerweetbix&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In Part Two, I demonstrated how to implement the basics of the join table solution in FileMaker.  While the solution works fine as an illustration for join tables, it lacked many of the basic interface features that would make it a usable solution.  In part three, I will show how to implement some of these features, namely the following…</p>
<p><span id="more-82"></span></p>
<li>Better selection of a Student for an Enrollment</li>
<li>Deletion of Enrollments</li>
<li>Prevention of &#8220;over-enrolling&#8221; a course.</li>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Better Selection of a Student…</span></p>
<p>In Part two, selection of a student for a new enrollment consisted of knowing the students ID number and entering it into the field.  There was no feedback of whom the student was at any point &#8211; not very useful for anybody.</p>
<p>A much better way would be to build a value list of students, and allow the user to pick from a pre-defined list.  This will give them a visual on the student names.  For starters, we will just create a basic value list for students.</p>
<p><img class="aligncenter size-full wp-image-83" title="Student Value List" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-41.png?w=500&#038;h=405" alt="Student Value List" width="500" height="405" /></p>
<p>We have used the existing Students table occurrence to build the value list, which has also been setup to show all students.  This value list uses the option to display a second value.  Rather than deal with the students ID number, we have chosen to display the students full name as the <em>displayed</em> field.  Underneath, the students ID is still being chosen and inserted into our Enrollments::Student ID field.</p>
<p>Now, attach the value list to the Enrollments::Student ID field in the Enrollments portal. You will see that the students full name is instantly displayed if you are using the pop-up menu option.</p>
<p><img class="aligncenter size-full wp-image-84" title="Courses Layout with Value List" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-51.png?w=500&#038;h=218" alt="Courses Layout with Value List" width="500" height="218" /></p>
<p>Now students can be selected for an enrollment via the pop-up menu.  Now, this implementation is still not perfect.  For example, there is no restriction on enrolling the same student twice.  Also, if you have a large number of students, a pop-up menu is not the best option.  A better option would be to use a drop-down menu, which brings with it some advantages and disadvantages.  For now, we will stick with the popup-menu to demonstrate the technique, but may come back to these issues in a future article.</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Deletion of an Enrollment…</span></p>
<p>This is a simple one, but a necessary one.  We need some way to delete an enrollment.   By far the easiest way is to insert a button into the enrollments portal, and attach to it the single script action <em>Delete Portal Row</em>.  If you disable the dialog within this script step, the enrollment will be deleted instantly.</p>
<p>Sometimes however, this might be a dangerous action.  Hitting the delete button by accident will cause the enrollment to be deleted right away, so you might want to ask the user for confirmation before deleting.   Whether a confirmation is ever required is a topic that could be debated endlessly, but the technique would be as follows.   First, it is going to require a new script, called &#8220;Delete Enrollment&#8221;.  The script itself would look something like:</p>
<p><img class="aligncenter size-full wp-image-85" title="Delete Enrollment Script" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-61.png?w=500&#038;h=230" alt="Delete Enrollment Script" width="500" height="230" /></p>
<p>A custom dialog is presented to the user, asking them if they really wish to delete the enrollment. The users action is then captured via the Get ( LastMessageChoice ) function.  1 corresponds to the default button action, typically &#8220;OK&#8221; (though you can specify any action for the default button).  If the user has clicked OK, we delete the portal row, otherwise we don&#8217;t.</p>
<p><img class="aligncenter size-full wp-image-86" title="Deletion Script Running" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-7.png?w=500&#038;h=342" alt="Deletion Script Running" width="500" height="342" /></p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Prevention of Over Enrolling a Course…</span></p>
<p>For this feature, we are going to need to record exactly how many enrollments are permitted for a given course.  This is going to be done by introducing a new field into the Courses table called <em>Max Enrollments</em>, type <em>number</em>.</p>
<p>We create enrollments currently by using the relationship option <em>Allow creation of records in this table via this relationship</em>.  This has been fine up until this point.  But now that we wish to control how many enrollments are created, it is going to make more sense to disable this feature, and script our enrollment creation instead.  By scripting the creation process, we can check whether the maximum number of enrollments has been reached, and prevent the user from adding more gracefully.  (also, not to mention that having a blank portal row in the enrollments portal as a means to create enrollments is not exactly intuitive for users).</p>
<p>For this,  we will need to do three things:</p>
<li>Disable the relationship creation option.</li>
<li>Place an &#8220;Add Enrollment&#8221; button to the layout</li>
<li>Create a script &#8220;Add Enrollment&#8221; to handle the creation of enrollments.</li>
<p>The script is going to need to do the following things:</p>
<li>Determine if the maximum number of enrollments reached</li>
<li>If yes, then do not create a new enrollment.</li>
<li>If no, then create an enrollment.</li>
<p>Here is the script might look like:</p>
<p><img class="aligncenter size-full wp-image-87" title="Add Enrollment Script" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-8.png?w=500&#038;h=280" alt="Add Enrollment Script" width="500" height="280" /></p>
<p>The first thing this script does is two error checks:</p>
<li>If the max number of enrollments field has not been set, then do not proceed, exit.</li>
<li>If the number of course enrollments matches the limit, then do not proceed, exit.</li>
<li>If these error checks pass, then create the enrollment, and set the course ID into it.</li>
<li>Finally, go back to the Courses layout, and place the user on the new enrollment.</li>
<p><img class="aligncenter size-full wp-image-88" title="New Courses Layout" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-9.png?w=499&#038;h=251" alt="New Courses Layout" width="499" height="251" /></p>
<p>Here you can see the new layout design.  The blank portal row for creation of enrollments is gone. In its place is an &#8220;Add Enrollment&#8221; button.  The new field &#8220;Max Enrollments&#8221; is also present, and has been set to 3.  This means that we should only be allowed to create three enrollments.</p>
<p><img class="aligncenter size-full wp-image-90" title="Max Enrollments Reached" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-101.png?w=500&#038;h=230" alt="Max Enrollments Reached" width="500" height="230" /></p>
<p>It may be a little difficult from this picture to tell what has happened, but I have reached my limit of three enrollments. Now, clicking the &#8220;Add Enrollment&#8221; button does nothing.</p>
<p>Can this be made any more intuitive to the user?  Well, we could easily place a custom dialog into our &#8220;Add Enrollment&#8221; script when the user tries to click the button when the maximum number of enrollments is reached.  OR, we can use conditional formatting to convey to the user visually that this is the case, saving them the attempt at clicking the button.</p>
<p>First, we can conditionally format the button to appear inactive when the maximum number of enrollments is reached:</p>
<p><img class="aligncenter size-full wp-image-91" title="Max Enrollments not empty, and Max limit reached…" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-111.png?w=500&#038;h=89" alt="Max Enrollments not empty, and Max limit reached…" width="500" height="89" /></p>
<p><img class="aligncenter size-full wp-image-92" title="Conditional Formatting to Grey Out Button" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-12.png?w=500&#038;h=358" alt="Conditional Formatting to Grey Out Button" width="500" height="358" /></p>
<p><img class="aligncenter size-full wp-image-93" title="The End Result" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-13.png?w=500&#038;h=242" alt="The End Result" width="500" height="242" /></p>
<p>The same type of conditional formatting can be applied to the &#8220;Max Enrollments&#8221; field also if you wish.</p>
<p>Every solution presents its own problems.  As you may have realised, there is nothing stopping a user from increasing the max enrollments number,  creating enrollments, and then <em>reducing</em> the max enrollments number.  This is a way for a user to bypass the restriction imposed on the &#8220;Add Enrollment&#8221; button.  I won&#8217;t go into detail as to how this can be resolved, but some options would be:</p>
<p>Field Validation on the &#8220;Max Enrollments&#8221; field, so it can never be less than the number of enrollments that exist<br />
Script the setting/changing of the Max Enrollments Field<br />
Script Triggers to prevent a user from modifying it to a number less than the number of enrollments that exist.</p>
<p>All would be viable solutions, and perhaps might be discussed in a future article.</p>
<p>This concludes the series on Join Tables for now.  Hopefully you have learned something out of these articles, and perhaps picked up a few tips and techniques along the way which will help you turn your basic join table, into something more powerful and user friendly.</p>
<p>You can download the example file used in this article <a href="http://www.savefile.com/files/2133539">here.</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/filemakerweetbix.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/filemakerweetbix.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/filemakerweetbix.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/filemakerweetbix.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/filemakerweetbix.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/filemakerweetbix.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/filemakerweetbix.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/filemakerweetbix.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/filemakerweetbix.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/filemakerweetbix.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=82&subd=filemakerweetbix&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://filemakerweetbix.wordpress.com/2009/06/20/join-my-table-part-three/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8f1688e44d66b075196f05c9a1580dc6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">filemakerweetbix</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-41.png" medium="image">
			<media:title type="html">Student Value List</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-51.png" medium="image">
			<media:title type="html">Courses Layout with Value List</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-61.png" medium="image">
			<media:title type="html">Delete Enrollment Script</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-7.png" medium="image">
			<media:title type="html">Deletion Script Running</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-8.png" medium="image">
			<media:title type="html">Add Enrollment Script</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-9.png" medium="image">
			<media:title type="html">New Courses Layout</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-101.png" medium="image">
			<media:title type="html">Max Enrollments Reached</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-111.png" medium="image">
			<media:title type="html">Max Enrollments not empty, and Max limit reached…</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-12.png" medium="image">
			<media:title type="html">Conditional Formatting to Grey Out Button</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-13.png" medium="image">
			<media:title type="html">The End Result</media:title>
		</media:content>
	</item>
		<item>
		<title>Sub-Summaries, and Displaying % of Total</title>
		<link>http://filemakerweetbix.wordpress.com/2009/06/18/sub-summaries-and-displaying-of-total/</link>
		<comments>http://filemakerweetbix.wordpress.com/2009/06/18/sub-summaries-and-displaying-of-total/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 10:43:32 +0000</pubDate>
		<dc:creator>filemakerweetbix</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[Report]]></category>
		<category><![CDATA[Sub-Summary]]></category>
		<category><![CDATA[Summary Fields]]></category>

		<guid isPermaLink="false">http://filemakerweetbix.wordpress.com/?p=77</guid>
		<description><![CDATA[Recently on the Cafe Forum over at FileMaker Today, someone asked if it was possible on a sub-summary report, to display the percentage of records contained within that sub summary.  Having never needed this functionality before, I decided to investigate how this might be done.  What I came up with is a fairly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=77&subd=filemakerweetbix&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently on the <a href="http://filemakertoday.com/com/index.php">Cafe Forum</a> over at <a href="http://www.filemakertoday.com">FileMaker Today</a>, someone asked if it was possible on a sub-summary report, to display the percentage of records contained within that sub summary.  Having never needed this functionality before, I decided to investigate how this might be done.  What I came up with is a fairly simple and straightforward way to implement this.</p>
<p><span id="more-77"></span><br />
You can download the example file for this article <a href="http://www.digitalfusion.co.nz/filemakerweetbix/Sub_Summaries_and_Displaying_Percent_of_Total.fp7">Here.</a> (right click / save as)</p>
<p>First, a little background on sub-summary reports.  In FileMaker, reports are run on a given set of records, called the found set.   They come from a single table, however if the records contain information in other tables via a relationship, then that information can be displayed if needed.  Within the found set of records, there may be certain records that can be grouped together.  A classic example would be a Customers table that contained among other things, a field to record the country a customer is from.  Now, lets say the user wishes to produce a report of their customers.  The easiest way would be to just create a layout, based on a customers table occurrence, and place some common customer fields on the layout, such as the customers name, country, and contact details.</p>
<p>Now, let&#8217;s say the user wishes to group customers by their countries on the report.  This would make sense from a sales perspective.  It would be nice to see all customers for a given country grouped together.  It would also be nice to see how many customers there are for each country, and finally it would be handy to see what percentage of the overall customer base each country produces.</p>
<p>All of this can be accomplished very easily by using a special layout &#8220;part&#8221; called a &#8220;sub summary&#8221;.   Think of a sub summary part is a header, but for a sub set of records (in our case, country will be the header for our sub-sets of customer records).</p>
<p>There are two important things to know when using a sub-summary part for a report, these are:</p>
<p>• In the sub-summary part setup box, you must specify a &#8220;break field&#8221;.  This is the field that &#8220;breaks&#8221; up the records into various groups (in our case, the Country field)<br />
• In order to correctly display the sub summary report,  your records must be sorted by this break field.</p>
<p>In versions of FileMaker prior to 10, there is an added requirement in that you must be in Preview mode.  FileMaker 10 has a new feature in that sub-summary parts will display correctly whilst in browse mode, though you must still ensure your records are sorted by the break field.</p>
<p>Back to the issue at hand.  Normally in answering a question for a user, the best way to convey the solution is to build a small example file to demonstrate the technique, and this is exactly what I have done.</p>
<p>Enjoy!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/filemakerweetbix.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/filemakerweetbix.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/filemakerweetbix.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/filemakerweetbix.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/filemakerweetbix.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/filemakerweetbix.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/filemakerweetbix.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/filemakerweetbix.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/filemakerweetbix.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/filemakerweetbix.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=77&subd=filemakerweetbix&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://filemakerweetbix.wordpress.com/2009/06/18/sub-summaries-and-displaying-of-total/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8f1688e44d66b075196f05c9a1580dc6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">filemakerweetbix</media:title>
		</media:content>
	</item>
		<item>
		<title>Join my Table? &#8211; Part Two</title>
		<link>http://filemakerweetbix.wordpress.com/2009/06/14/join-my-table-part-two-soon/</link>
		<comments>http://filemakerweetbix.wordpress.com/2009/06/14/join-my-table-part-two-soon/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 08:21:04 +0000</pubDate>
		<dc:creator>filemakerweetbix</dc:creator>
				<category><![CDATA[Database Design]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[Join Table]]></category>
		<category><![CDATA[Schema]]></category>
		<category><![CDATA[Table]]></category>

		<guid isPermaLink="false">http://filemakerweetbix.wordpress.com/?p=18</guid>
		<description><![CDATA[This implementation assumes you have a basic concept of relational database theory, in particular the use of primary and foreign keys in tables.
As a brief catchup, a primary key is a field in a table which has a unique value for each record. A perfect example would be a serial number field, which has a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=18&subd=filemakerweetbix&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This implementation assumes you have a basic concept of relational database theory, in particular the use of primary and foreign keys in tables.</p>
<p>As a brief catchup, a primary key is a field in a table which has a unique value for each record. A perfect example would be a serial number field, which has a different number for each record. As good database practice, every table in your solution should have a primary key field, regardless of whether it is used or not.</p>
<p>A foreign key on the other hand, is a field in a table, which contains the primary key value of a record from another table. This is how two records in different tables are linked/related to one another, and indeed is how we are going to link an <strong>ENROLLMENT</strong> to both a <strong>STUDENT</strong> and a <strong>COURSE</strong>.</p>
<p><span id="more-18"></span></p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Table Setup</span></p>
<p>This solution is going to require the three tables mentioned above. It is very straightforward to create the tables. Each table will require a primary key, plus whatever fields you wish to capture information for, as a very basic example:</p>
<p><strong>STUDENTS:</strong></p>
<li>Student ID (Primary key)</li>
<li>First Name</li>
<li>Last Name</li>
<li>Phone Number</li>
<div id="attachment_70" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-70" title="Students" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-11.png?w=500&#038;h=152" alt="Students" width="500" height="152" /><p class="wp-caption-text">Students</p></div>
<p><strong>COURSES</strong></p>
<li>Course ID (Primary key)</li>
<li>Course Name</li>
<li>Location</li>
<li>Start Time</li>
<div id="attachment_70" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-70" title="Students" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-2.png?w=500&#038;h=152" alt="Courses" width="500" height="152" /><p class="wp-caption-text">Courses</p></div>
<p><strong>ENROLLMENTS</strong></p>
<li>Enrollment ID (Primary key)</li>
<li>Enrollment Date</li>
<li>Fee</li>
<li>Grade</li>
<li>Student ID (Foreign key)</li>
<li>Course ID (Foreign key)</li>
<div id="attachment_70" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-70" title="Students" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-3.png?w=500&#038;h=152" alt="Enrollments" width="500" height="152" /><p class="wp-caption-text">Enrollments</p></div>
<p>You can see that <strong>ENROLLMENTS</strong> has two foreign key fields, because we wish to relate an enrollment record to both a <strong>STUDENT</strong> record and a <strong>COURSE</strong> record.</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Relationship Setup</span></p>
<p>How you setup your relationship graph is dependent upon personal preference. In fact, you can successfully implement this solution without having any relationships between the tables at all. However if you want to be able to see enrollments for either a student or course perspective on your layouts, you will need relationships.</p>
<p>In this example I will setup the most simplest of relationships. I have related <strong>ENROLLMENTS</strong> to both <strong>STUDENTS</strong> and <strong>COURSES</strong> via the key field associations as mentioned in the above section.</p>
<li>Enrollments::Student ID = Students::Student ID</li>
<li>Enrollments::Course ID = Courses::Course ID</li>
<div id="attachment_70" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-70" title="Students" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-4.png?w=500&#038;h=152" alt="TO Setup" width="500" height="152" /><p class="wp-caption-text">TO Setup</p></div>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Building a Course Layout</span></p>
<p>This solution is going to require layouts for data entry. It will most likely have a Students layout, a Courses layout, and an Enrollments layout.</p>
<p>For this section I will focus on the Course layout only. Adding course-specific fields to this layout is easy. The layout is based on the Courses <em>table occurrence</em>, and so you can place course fields straight onto it.</p>
<p>A useful thing to have on this layout would be a list of all the enrollments for the current course. This can be achieved by placing a portal on the layout. The portal will be based on the Enrollments table occurrence.  Be sure to select the related Enrollments table occurrence &#8211; the one that has the relationship between itself and the Courses table occurrence.</p>
<p>The fields you will want to put in the portal are basically all the fields from the Enrollments with the exception of a couple.  First, it makes little sense to put Enrollment ID in the portal unless you are using this to identify your enrollments.  Second,  putting Course ID into the portal is redundant, since we are guaranteed that every record that displays in the portal will have the same Course ID as the parent course record,  the relationship defines this condition.</p>
<p>So a basic layout might look like this:</p>
<div id="attachment_70" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-70" title="Students" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-6.png?w=500&#038;h=152" alt="Basic Layout" width="500" height="152" /><p class="wp-caption-text">Basic Layout</p></div>
<p>I have pre-populated all tables with a few records to illustrate how this will look.  You can see here that the course has three enrollments.</p>
<p>This layout is fine for viewing course enrollments, but more often than not users wish to directly add enrollments from this layout.  The easiest way to allow this is to turn on the <em>Allow creation of records in this table via this relationship</em> option on the relationship dialog.  You will want to turn it on for the Enrollments side of the relationship, since it is these records you want to create.</p>
<div id="attachment_70" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-70" title="Students" src="http://filemakerweetbix.files.wordpress.com/2009/06/picture-5.png?w=500&#038;h=152" alt="Enabling Creation" width="500" height="152" /><p class="wp-caption-text">Enabling Creation</p></div>
<p>Now,  enrollment records can be created directly from the Courses layout by entering information into the last portal row.</p>
<p>While this is a fully workable solution so far, it lacks many nice features which make it usable for the average user.  Current limitations include:</p>
<p>User must know a Students ID to add an enrollment<br />
No visible way to delete enrollments<br />
No restriction on number of enrollments created</p>
<p>This solution can be taken much further with a few simple techniques, some of which will be discussed in part three to this article coming soon!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/filemakerweetbix.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/filemakerweetbix.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/filemakerweetbix.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/filemakerweetbix.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/filemakerweetbix.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/filemakerweetbix.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/filemakerweetbix.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/filemakerweetbix.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/filemakerweetbix.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/filemakerweetbix.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=18&subd=filemakerweetbix&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://filemakerweetbix.wordpress.com/2009/06/14/join-my-table-part-two-soon/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8f1688e44d66b075196f05c9a1580dc6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">filemakerweetbix</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-11.png" medium="image">
			<media:title type="html">Students</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-2.png" medium="image">
			<media:title type="html">Students</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-3.png" medium="image">
			<media:title type="html">Students</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-4.png" medium="image">
			<media:title type="html">Students</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-6.png" medium="image">
			<media:title type="html">Students</media:title>
		</media:content>

		<media:content url="http://filemakerweetbix.files.wordpress.com/2009/06/picture-5.png" medium="image">
			<media:title type="html">Students</media:title>
		</media:content>
	</item>
		<item>
		<title>Join my Table? &#8211; Part One</title>
		<link>http://filemakerweetbix.wordpress.com/2009/06/12/join-my-table-part-one/</link>
		<comments>http://filemakerweetbix.wordpress.com/2009/06/12/join-my-table-part-one/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 10:20:11 +0000</pubDate>
		<dc:creator>filemakerweetbix</dc:creator>
				<category><![CDATA[Database Design]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[Join Table]]></category>
		<category><![CDATA[Schema]]></category>
		<category><![CDATA[Table]]></category>

		<guid isPermaLink="false">http://filemakerweetbix.wordpress.com/?p=20</guid>
		<description><![CDATA[Perhaps one of the most asked questions that I see on the Cafe Forum over at FileMaker Today, is &#8220;How do I do join tables?&#8221;. While some users have an understanding of what they are, they may lack the FileMaker skills to implement them. Others are unfamiliar with the concept altogether, but will explain their [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=20&subd=filemakerweetbix&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Perhaps one of the most asked questions that I see on the <a href="http://filemakertoday.com/com/index.php">Cafe Forum</a> over at <a href="http://www.filemakertoday.com">FileMaker Today</a>, is &#8220;How do I do join tables?&#8221;. While some users have an understanding of what they are, they may lack the FileMaker skills to implement them. Others are unfamiliar with the concept altogether, but will explain their real word example. Usually it is a prime candidate for a join table. This article provides a real world example that will give you an understanding of why join tables are important, and in what circumstances they should be used. The example will then be implemented in a simple FileMaker solution.</p>
<p><span id="more-20"></span></p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Let&#8217;s get started.</span></p>
<p>Ponder this real world scenario…</p>
<p><em>&#8220;Joe want&#8217;s to build a database to manage the computer courses he offers to senior citizens. Being a one-man business, he only offers five courses. He wishes to capture information on his students, his courses, and who has enrolled in which courses.&#8221;</em></p>
<p>This scenario is very easy to understand when reading in plain english. Now lets deconstruct this scenario further.</p>
<p>When building a database from a users specification, one of the first things you should do is identify the potential tables:</p>
<li>Joe wants to record info about his students, so we will need a <strong>STUDENTS</strong> table.</li>
<li>Joe wants to record info about his courses, so we will need a <strong>COURSES</strong> table.</li>
<li>Joe wants to record who has enrolled, so we will need an <strong>ENROLLMENTS</strong> table.</li>
<p>With the main tables identified, can you begin to spot what might be the join table? Perhaps one last step will make it more apparent. Lets define in more specific terms which each table will capture within a single record:</p>
<li><strong>STUDENTS</strong>: Information about a particular student.</li>
<li><strong>COURSES</strong>: Information about a particular course</li>
<li><strong>ENROLLMENTS</strong>: Information about a particular student <strong>AND</strong> a particular course</li>
<p>How about now? Can you spot the join table? I think it is time to let the cat out of the bag. A join table is a tool by which you link two other tables together, or to put it in more defined terms:</p>
<p><em>A join table is used to establish a &#8220;many to many&#8221; relationship between two tables.</em></p>
<p>What does &#8220;many to many&#8221; mean? Well, in terms of the scenario it means this:</p>
<li>A student can take <strong>MANY</strong> courses</li>
<li>A course can be taken by <strong>MANY</strong> students</li>
<p>By using a join table, you are giving yourself much more freedom to capture as much information as you want, without compromising the integrity of your other tables. The <strong>STUDENTS</strong> table should only capture information about the student, such as their contact details. Likewise, the <strong>COURSES</strong> table should only capture information specific to a course, such as it&#8217;s name, location, and start time.</p>
<p>An <strong>ENROLLMENT</strong> is a thing, it&#8217;s a tangible, legitimate thing that you will want to capture information about, so it should have its own table.. It will capture who the student is, and which course they are enrolling in. In addition to that, it could capture information such as:</p>
<li>Enrollment Date</li>
<li>Fee</li>
<li>Grade</li>
<p>This information only makes sense if it is pertaining to a person for a specific course &#8211; a grade is meaningless to a course if you don&#8217;t know whose grade it is. Alternatively a grade is meaningless to a student if you don&#8217;t know for which course it was obtained.</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Please Do Not Try This At Home…</span></p>
<p>So why not capture this enrollment information on the students table, and save us the extra table?</p>
<p>Doing this is bad. It is so bad in fact, that words cannot describe that badness it brings, on a badosity meter it would be off the charts&#8230;. If someone were to try it, let&#8217;s see how it would go.</p>
<p>Right, so we want to capture enrollment information on the Students table. Well, let&#8217;s start by capturing information about the first enrollment a student takes in a course. We will probably need some fields to capture this information:</p>
<li>Course ID (<strong>foreign key</strong>)</li>
<li>Enrollment Date</li>
<li>Fee</li>
<li>Grade.</li>
<p>So far so good. Oh look, Peter Jones just enrolled &#8220;Join Tables for Dummies&#8221; which has a Course ID of 5. So I will now go to Peter Jones&#8217; record, and fill in my information:</p>
<li>Course ID = 5</li>
<li>Enrollment Date = 11/06/2009</li>
<li>Fee = 25.00</li>
<li>Grade = &#8220;&#8221;</li>
<p>Great. I have successfully captured all the enrollment information I need for Peter Jones enrolling in this course. When the course ends, I can fill in his Grade and all will be good&#8230; But wait.. Peter also wants to enroll in &#8220;Bad Database Design&#8221;. Where am I going to record THAT enrollment information? Well lets see, I could just create more fields to capture it, so I&#8217;ll do that.</p>
<li>Course ID 2 = 10</li>
<li>Enrollment Date 2 = 11/06/2009</li>
<li>Fee 2 = 50.00</li>
<li>Grade 2 = &#8220;&#8221;</li>
<p>Phew, glad that is over. I&#8217;ve still managed to capture information on his two enrollments&#8230;&#8230;</p>
<p><span style="color:red;font-weight:bolder;">* 6 Months Later…… *</span></p>
<p>WHAT?? Peter wants to enroll AGAIN in <strong>MORE COURSES</strong>??? What am I going to do?? I know&#8230; MORE AND MORE FIELDS !!!!!</p>
<p>Wrong.</p>
<p>Already this method has gone down the toilet. I am making the problem much worse by adding a new set of fields to the table for every enrollment. Every time a student enrolls in a course, the database schema must be modified. In short, avoid this like the plague. You don&#8217;t want to know what kind of problems you will get into when you want to start running reports! Some people who have tried this method have also gone the way of repeating fields. Rather than 1 field per enrollment, they create 1 field, with many repetitions &#8211; one repetition per enrollment. This is just as bad.</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Stay tuned for Part Two coming very soon…</span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/filemakerweetbix.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/filemakerweetbix.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/filemakerweetbix.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/filemakerweetbix.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/filemakerweetbix.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/filemakerweetbix.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/filemakerweetbix.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/filemakerweetbix.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/filemakerweetbix.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/filemakerweetbix.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=20&subd=filemakerweetbix&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://filemakerweetbix.wordpress.com/2009/06/12/join-my-table-part-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8f1688e44d66b075196f05c9a1580dc6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">filemakerweetbix</media:title>
		</media:content>
	</item>
		<item>
		<title>Thinking Outside the Loop</title>
		<link>http://filemakerweetbix.wordpress.com/2009/06/12/thinking-outside-the-loop/</link>
		<comments>http://filemakerweetbix.wordpress.com/2009/06/12/thinking-outside-the-loop/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 06:37:16 +0000</pubDate>
		<dc:creator>filemakerweetbix</dc:creator>
				<category><![CDATA[Database Design]]></category>
		<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[Loop]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Speed]]></category>

		<guid isPermaLink="false">http://filemakerweetbix.wordpress.com/?p=5</guid>
		<description><![CDATA[If you have spent any time developing in FileMaker, or programming in almost any language, you will be familiar with the concept of a loop. And when scripting your loops you probably have a favourite method that you use. This article presents and compare a number of looping techniques that can be used in FileMaker.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=5&subd=filemakerweetbix&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you have spent any time developing in FileMaker, or programming in almost any language, you will be familiar with the concept of a loop. And when scripting your loops you probably have a favourite method that you use. This article presents and compare a number of looping techniques that can be used in FileMaker.</p>
<p><span id="more-5"></span></p>
<p>To help illustrate the looping techniques we will use the following example. Let’s assume that our solution is a simple CRM which has a Contacts table.  The solution also has a letter writing screen where we can compose letters (the things people used before email).  To make the best use of this facility, it should be able create a letter, and print a personalised version for each contact, including their name, address and so forth. </p>
<p>I won’t go into the detail of how this merge function would be implemented, but in order to print these personalised letters we require three important things:<br />
 <br />
 • A “Letters” table to store the lettersRecords for each individual letter<br />
 • A field to act as a link between the letter and a contact record (Contact ID).</p>
<p>Now let’s think about how the letter might be composed. The most basic implementation would be a global text field to contain the letter currently being composed.  So on our curent table which we’ll call “Home”,  we create this global field.  We also need to figure out who our recipients are going to be.  We’re going to assume that whenever we write a letter, we wish to send it to all of our contacts.</p>
<p>Now to put things into perspective and give some idea of what’s going on.  In the letter, we use special merge items which act as place holders for the actual contact information that will be substituted in later on.  A classic example of this would be using a merge item as a place holder for a contacts name, ie:</p>
<p><code>Dear **First Name**</code></p>
<p>Later on, we would want to swap **First Name** with an actual contacts first name.</p>
<p>Anyways, to get back on track here,  it is time to create records in the letters table.  How should we go about this?   Well,  given the title of this article, we could&#8230;. use a loop!  We can loop through every contact in the database, creating a letter record for them.  </p>
<p>What follows is five examples of loops that we could use.</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Method One &#8211; Layout Switching</span></p>
<p><code>Go to Layout [Home ]<br />
Set Variable [$Letter ; Home::Letter Global ]<br />
Go to Layout [Contacts ]<br />
Show All Records<br />
Go to Record/RequestPage [First ]<br />
Loop<br />
  Set Variable [$ContactID ; Contacts::Contact ID ]<br />
  Go to Layout [Letters ]<br />
  New Record/Request<br />
  Set Field [Letters::Contact ID ; $ContactID ]<br />
  Set Field [Letters::Letter Contents ; $Letter ]<br />
  Go to Layout [Contacts ]<br />
  Go to Record/Request/Page [Next ; Exit After Last ]<br />
End Loop</code></p>
<p>This script begins by storing the letter contents in a variable so it can be used throughout the script.  It then loops through every record in the Contacts table,  grabbing each Contact ID number in turn, before switching to the Letters layout and creating a record for that contact.  This process repeats until it has gone through every contact (the exit condition).</p>
<p>While easy enough to follow, this loop is inefficient for a couple of reasons.  First,  there are two layout changes that are made during each iteration of the loop:  the first is a change to the letters layout, and the second is a change back to the contacts layout.  If we had 20,000 contacts in our database, that is 20,000 layout switches made,  in addition to the 20,000 letter records created.  It also sets two fields, and one variable during each iteration of the loop.</p>
<p>So if layout switching proves to be too inefficient, can we get rid of them?  Yes.  The answer lies in the use of script variables.  If we can store every contacts ID number in a single step, and then loop through that list to obtain our contact IDs, we would not need to change layouts. </p>
<p>Let’s see how that might look if it were scripted:</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Method Two &#8211; The Counter Approach</span></p>
<p><code>Go to Layout [Home ]<br />
Set Variable [$Letter ; Home::Letter Global ]<br />
Set Variable [$ContactIDs ; List ( AllContacts::Contact IDs ) ]<br />
Go to Layout [Letters ]<br />
Set Variable [$Total Contacts ; ValueCount ( $ContactIDs ) ]<br />
Set Variable [$Counter ; 1 ]<br />
Loop<br />
  New Record/Request<br />
  Set Field [Letters::ContactID ; GetValue ( $ContactIDs ; $Counter ) ]<br />
  Set Field [Letters::Letter Content ; $Letter ]<br />
  Set Variable [$Counter ; $Counter + 1 ]<br />
  Exit Loop If [$Counter &gt; $Total Contacts ]<br />
End Loop</code></p>
<p>This time,  we are storing all of our Contact IDs in a single variable called $ContactIDs.   To do this, we  create a relationship between “Home” and “AllContacts” table occurrences, where “AllContacts” is based on the Contacts table.   The relationship can be a cross-product relationship type (X) since we wish to relate to all contact records.   the List function is used to return every contact ID via the relationship.</p>
<p>The next important step is at line #5 where we set the variable $Total Contacts.  This is set to the total number of contacts, by using the ValueCount function.  It will also help us to determine how many iterations of the loop we need to perform.   We set a new variable &#8211; $Counter &#8211; which is used to keep track of the loop iteration progress.</p>
<p>To obtain the correct contact ID to store in a new letter record, we use the GetValue function. It lets us obtain a value at a specific position in a list.   In this case, our list is $ContactIDs , and our position is $Counter.   As an example, on the first iteration of the loop, we grab the contact ID at position 1, on the second we grab position 2, third 3, and so on&#8230;</p>
<p>As each loop iteration is complete, the $Counter variable is incremented, and compared to $Total Contacts.  If the value exceeds that of $Total Contacts, we know to stop the loop because we have created the correct number of letters.</p>
<p>A counter seems like a great idea, and we have removed the need to change layouts.  But do we really need a counter?  Further to that, is all that counter management inefficient?  Have a look at this example:</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Method Three &#8211; Chopping a List</span></p>
<p><code>Go to Layout [Home ]<br />
Set Variable [$Letter ; Home::Letter Global ]<br />
Set Variable [$ContactIDs ; List ( AllContacts::Contact IDs ) ]<br />
Go to Layout [Letters ]<br />
Loop<br />
  New Record/Request<br />
  Set Field [Letters::ContactID ; GetValue ( $ContactIDs ; 1 ) ]<br />
  Set Field [Letters::Letter Content ; $Letter ]<br />
  Set Variable [$ContactIDs ; RightValues ( $ContactIDs ; ValueCount ( $ContactIDs ) - 1 ) ]<br />
  Exit Loop If [isEmpty ( $ContactIDs ) ]<br />
End Loop</code></p>
<p>Here we have eliminated the need for $Counter.  This method reduces the size of our initial list of contact IDs by one for each iteration of the loop.  During each iteration, the first contact ID in the list is used in the new record.  Afterwards, $ContactIDs is “trimmed” by “chopping off” the first contact ID, and leaving the remainder.  The second ID now becomes the first.  This process repeats in each iteration until the list is chopped down until no ID’s remain, at which point the loop exits.</p>
<p>Great, now what? How about something completely different.  Here is a method that uses the replace records script step:</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Method Four &#8211; Replacing</span></p>
<p><code>Go to Layout [Home ]<br />
Set Variable [$Letter ; Home::Letter Global ]<br />
Set Variable [$ContactIDs ; List ( AllContacts::Contact IDs ) ]<br />
Set Variable [$Total Contacts ; ValueCount ( $ContactIDs ) ]<br />
Go to Layout [Letters ]<br />
Show All Records<br />
Omit Record<br />
Show Omitted Only<br />
Omit Record<br />
Set Variable [$Counter ; 1 ]<br />
Loop<br />
  New Record/Request<br />
  Set Variable [$Counter ; $Counter + 1 ] ;<br />
  Exit Loop If [isEmpty ( $ContactIDs ) ]<br />
End Loop<br />
Replace Field Contents [No Dialog ; Letters::Letter Content ; $Letter ]<br />
Replace Field Contents [No Dialog ; Letters::Contact ID ; GetValue ( $ContactIDs ; Get ( RecordNumber ) ) ]</code></p>
<p>The basic idea is this:  start with an empty found set of Letters,  generate the required number of letters, and then use two replace field contents script steps on the found set.   If I was a scientist, and proposting a hypothesis, it might be that two replace steps will perform faster than 40,000 set field script steps,  is the hypothesis true? We’ll find out soon&#8230;</p>
<p>Finally, and perhaps most unintuitively, is a method that will make use of a handy feature of the import records script step.  You may have noticed when using this script step, that you are given the option when importing a repeating field, to either keep the values in a repeating field in it’s original record,  OR split values into separate records.  Hmmmmm,  that would mean if we had a repeating field with 20,000 repetitions, and each repetition contained a Contact ID,  and we could then split them into separate records, we would get 20,000 records.  That sounds like something we might be interested in!</p>
<p>If we could create this repeating field on the Home table, and were to import this repeating field to the Letters table, we could theoretically create the required number of records using this one single step.</p>
<p>Let’s see what that might look like.</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Method Five &#8211; Import Madness</span></p>
<p><code>Go to Layout [Home ]<br />
Show All Records<br />
Omit Record<br />
Show Omitted Only<br />
Set Variable [$Letter ; Home::Letter ]<br />
Set Variable [$$ContactIDs ; List ( AllContacts::Contact ID ) ]<br />
Import Records [No Dialog ; “LoopTests.fp7”; Add; Mac Roman ]</code></p>
<p>Well, first impressions would indicate that it certainly looks like a smaller script with fewer steps, however does that translate to a faster script?  We’ll see soon.</p>
<p>A couple of things should be noted here.  First, lines two through 4 are required to make our found set a single record on the Home table.  This is required for the import, because we only wish to import from a single record.  Next, we have changed the variable $ContactIDs into a global variable, $$ContactIDs.  The reason for this is to correctly setup our repeating Contact IDs field on the Home table.</p>
<p>I have created a repeating field called “Contact IDs” on the Home table.  This is a calculated repeating field, and the calculation looks like this:</p>
<p><code>GetValue ( $$ContactIDs ; Get ( CalculationRepetitionNumber ) )</code></p>
<p>The calculation references our global variable set in the script.  For any given repetition, the Xth value in $$ContactIDs is set into it.   For example,  the fifth repetition will contain the fifth contact ID in our $$ContactIDs list.  Similarly the 19,574th repetition will contain the 19,574th contact ID.</p>
<p>Back in the script,  the import records step has been setup to import from the Home table occurrence to the Letters table occurrence, and its import mapping looks like:</p>
<p><code>Home::Letter  ---&gt;  Contacts::Letter Contents</code><br />
<code>Home::Contact IDs  ---&gt;  Letters::Contact ID</code></p>
<p>The option to split repeating field values into seperate records has been turned ON.   With 20,000 repetitions in our Contact IDs repeating field, all calculating to a specific Contact ID,  we end up with 20,000 records created in the Letters table, each with a unique Contact ID.</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Testing and Results discussion</span></p>
<p>Time to test these loops.  Tests were run on a database with 20,000 contact records and a single letter in a global field.  The same table structure was used as in the article example.  The test machine is running FileMaker 10 Pro Advanced, on an Apple Intel MacBook, 2.0 Ghz core 2 duo with 2gb DDR3 ram, and the operating system is OS X 10.5 Leopard.</p>
<p>Each Looping method was run three times and times were averaged.  However it should be noted that in all cases, the variances between test times for a given loop were very small, in the range of .1 to .2 seconds.</p>
<p>Method One &#8211; Layout Switching:    53 seconds<br />
Method Two &#8211; The Counter Approach:   <span style="color:red;font-weight:bold;">24 seconds</span><br />
Method Three &#8211; Chopping a List:    67 seconds<br />
Method Four &#8211; Replacing:     25 seconds<br />
Method Five &#8211; Import Madness:    47 seconds</p>
<p>Was it what you expected?    The best performed looping method was the counter approach, closely followed by by the replace field contents method.  The import came in third, almost twice as slow as the first two.  Method one with the layout switching was fourth,  and far behind in last was method three &#8211; Chopping a list.</p>
<p>So why do you think the results are the way they are?  To get an idea, we’ll first start with the slowest method &#8211; Chopping a list.   To me, the first thing I notice is that this method calls three functions during each iteration of the loop:  GetValue, RightValues, and ValueCount.   Each one of these is a relatively intensive process, and to repeat each 20,000 times is the major contributing factor to the slowness of this method.   The lesson here is to avoid intensive function calls in a loop where possible.</p>
<p>Method two &#8211; the Counter approach &#8211; is the exact opposite approach.  In this method, there is only a single function call in the loop &#8211; GetValue.  GetValue is not nearly as demanding as the RightValues, or ValueCount functions.   We also only need to perform the ValueCount function once, and outside of the loop.</p>
<p>Layout switching, while not as demanding as some functions, is still a fairly time consuming step and should also be avoided where possible.</p>
<p>The replace records method, while very fast, giving the counter approach a run for its money, feels a bit like overkill for what is required.  It’s a good example how to think outside the box and look at other ways to approach a fairly typical situation.   The reason it is very close in time to the counter approach, is because it too contains a single repeated function call to GetValue, which is done 20,000 times.</p>
<p>The final method, of using an import with a calculated repeating field, performs around the middle range in comparison to the other methods.  It is another good example of thinking outside the box to solve a problem, but might not be the best method for this particular problem&#8230;. or is it?  Stay tuned!</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Combining Methods for the Ultimate speed</span></p>
<p>Well, the loops are written, the tests are done, and the counter method is the winner.  It seems that reducing the number of function calls, can drasticaly increase your loop speed.   But what about that import?  I’m sure that when I have done imports in the past,  they seem to create records faster than I could expect.  Is there something more to this than meets the eye?</p>
<p>Time to think outside the box again.   What if we run another test.  This time, no field setting, just straight up record creating.  Is it faster to create records by a loop, or an import?</p>
<p>For this example,  we will use a standard loop to generate 20,000 records.   We will also use a repeating field for the import creation.  However this time the repeating field will not be a calculation, it will be pre-set with 20,000 values in the repetitions.</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Generator 1 &#8211; A simple Loop</span></p>
<p><code>Go to Layout [Letters ]<br />
Set Variable [$Counter ; 1 ]<br />
Loop<br />
  New Record/Request<br />
  Set Variable [$Counter ; $Counter + 1 ]<br />
  Exit Loop If [$Counter &gt; 20000 ]<br />
End Loop</code></p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Generator 2 &#8211; An Import</span></p>
<p><code>Import Records [No Dialog ; “LoopTests.fp7”; Add; Mac Roman ]</code></p>
<p> </p>
<p>What are the results?  The simple scripted loop took a whopping 34 seconds to generate the required records.   That’s even slower than if it had to set two fields during each iteration of the loop!   It makes no sense, but after first being a disbeliever I tried it many more times with the same result.   Perhaps this is something FileMaker will need to take a look at.  Suffice to say, if you’re going to create many records in a single script, set something!</p>
<p>Anyways, with that nice little surprise out of the way,  let’s see how the import generator went&#8230;. 2 seconds&#8230;  2 SECONDS !!!!!!!   It took 2 seconds to create 20,000 records !!!!  That’s over TEN TIMES faster than any previous method known to man (or this article&#8230;)</p>
<p>If only there were some way to harness this amazing speed.   We know the record creation part of this method can be incredibly fast,  but what else is required to obtain this speed?  Well,  recall that the repeating field in this example is a normal un-calculated field with its repetition values preset.  If we were to use this method, we would need to preset 20,000 repetitions into our field, then run the import.  How can we set these repetitions? How about a loop!  What have we shown to be the fastest looping method so far,  why a counter of course!   So let’s combine the two:</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Method Six &#8211; The Need for Speed</span></p>
<p><code>Go to Layout [Home ]<br />
Show All Records<br />
Omit Record<br />
Show Omitted Only<br />
Set Variable [$Letter ; Home::Letter Global ]<br />
Set Variable [$ContactIDs ; List ( AllContacts::Contact IDs ) ]<br />
Set Variable [$Total Contacts ; ValueCount ( $ContactIDs ) ]<br />
Set Variable [$Counter ; 1 ]<br />
Loop<br />
  Set Field [Home::Contact IDs[$Counter] ; GetValue ( $ContactIDs ; $Counter ) ]<br />
  Set Variable [$Counter ; $Counter + 1 ]<br />
  Exit Loop If [$Counter &gt; $Total Contacts ]<br />
End Loop<br />
Commit Records/Requests [Skip data entry validation; No dialog ]<br />
Import Records [No Dialog ; “Loop Examples.fp7” ; Add ; Mac Roman ]</code></p>
<p>So, what is going on here? Well we have combined a counter method with an import method.  First, we ensure that only one Home record is selected for the import later on.  Next we setup a normal counting loop as usual, but this time in the loop we are setting a repetition of our Contact IDs repeating field.   For example,  on the tenth iteration of the loop,  we are setting the tenth repetition to the tenth Contact ID in $ContactIDs, and so on for every repetition.  Finally when done, we use the import method to generate records by splitting the repetitions into separate records.</p>
<p>Will this be faster?  Is setting 20 thousand repetitions a faster process than setting 20 thousand fields in 20 thousand records? </p>
<p>Yes.</p>
<p>For this method, the average time required to generate the records is 20 seconds.  That’s a full four seconds faster than the previous best method, and well over twice as fast as perhaps the most common method, that of layout switching.</p>
<p> </p>
<p><span style="color:#2172A7;font-size:medium;">Conclusion</span></p>
<p>This article has outlined a number of different methods for carrying out the same task.  It illustrates how FileMaker gives you the basic set of tools required to solve a solution, but how you use them is up to you, but sometimes the most obvious solution may not always be the most efficient.  Hopefully it has offered some ideas and tips on how certain script steps and functions can be used for uses other than you might think.   I hope it has also demonstrated, that with a little thought and preparation by paying attention to what goes into your loop, that you can achieve significant speed increaseses.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/filemakerweetbix.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/filemakerweetbix.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/filemakerweetbix.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/filemakerweetbix.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/filemakerweetbix.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/filemakerweetbix.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/filemakerweetbix.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/filemakerweetbix.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/filemakerweetbix.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/filemakerweetbix.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=filemakerweetbix.wordpress.com&blog=8142874&post=5&subd=filemakerweetbix&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://filemakerweetbix.wordpress.com/2009/06/12/thinking-outside-the-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8f1688e44d66b075196f05c9a1580dc6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">filemakerweetbix</media:title>
		</media:content>
	</item>
	</channel>
</rss>