Learning Looping Power - Part 2

No Access? Watch the preview video here. LoopingPower2_Pre.mp4
AttachmentSize
LearningLoopingPower2.zip0 bytes
By Matt Petrowsky

This is the second part of a two part series dealing with really understanding how to take advantage of loops within FileMaker scripting.

Using the example of an event seating solution, I walk through data loops, portal loops, counter loops (commonly known as a for loop) and embedded loops.

The video showcases how to really optimize your loops for the fastest possible execution. Added to this are some really great tips about making your loops both as short as possible and super easy to read!

Comments

Create new related records

Hi Matt,

Very efficient use of looping. I have to say, I was even more intrigued by the technique of using a non-matching relationship through a blank field to create new records in the child table. This seems very useful, but I'm still a bit hazy on how to do it, and I wanted to ask if you either have suggested reading or could take it up in greater detail in a future video. For example, how would I use this example in real life to, for example, document what the kids turned up in their Easter baskets? Let's say Ewen found 4 jelly beans, one plastic egg filled with Cheddar bunnies, 3 Peeps, and one shiny rock, while Max found 6 jelly beans, a Cadbury egg, 2 pinecones, etc. I'm not being facetious, I just have Easter hunts on the brain. Would I have a button that says, enter swag for kid blank, with a script trigger that creates a new kid record on object save, and then a list of items in a portal that would be added as a 'found items' TO with a foreign key for the kidID?
I'm struggling, because this seems extremely powerful, but I can't quite figure out how I put it to use in a solution other than one that loops, and I feel like it could be very useful other places as well. Thanks for your help!

Cheers,
Bob