English

Record Looping with JS

The world of JavaScript libraries is so rich and full that once you start using some of them you start to ask yourself "Should I even try this natively with FileMaker?" When it comes to something like QR codes we don't even have a native option to create them. Currently, there's no GenerateBarcode() function.

There's also the situation where you're using one of these fabulous JavaScript Libraries and you want to loop through a found set of records. The problem is... — You try to use your new cool JavaScript library on a range of records. Creating a QR code for a collection of records. Just a few hundred or a few thousand is all you need.

There's a few problems with this situation however. One of them is that you MUST know how the FileMaker.PerformScript() function behaves within a Web Viewer. If it's not ready to go, then you'll get an error (which you can't even see unless you use a JavaScript debugger). The second issue is that FileMaker will simply stack any script calls until you get to the last record of a record loop and then execute them all on the last record. This is why you need to know the two critical things which must be set for successful loop based JavaScript use with a web viewer. Fortunately, we'll walk you through these critical issues and show you everything you need to keep in mind for using JavaScript, a Web Viewer and a Record Loop.

Tags:
AttachmentSize
QRCodes.zip115.11 KB

Learning to Master Looping

Without a fundamental understanding of some programming topics, it's often difficult to solve certain problems in the easiest possible fashion. In fact, one of the things I've enjoyed learning about programming is that more code isn't always better. Searching for the simple answer sometimes takes a bit more time. And, learning to solve the problem with less code is more enjoyable.

In this video, I walk through a simple process of massaging some data into a desired format. While the objective often seems simple, the solution isn't always obvious. Especially, if you haven't been programming for good amount of time. There's also those hidden tips or tricks which you don't really know about until you've invested the time into improving your craft.

I remember learning about writing loops in FileMaker and feeling the sense of power that comes with any type of data processing. To this day, most of programming comes down to looking for a pattern and then processing that pattern in some fashion. Usually, with a loop. As the seasons cycle and the fields wither and then return, such is the way of software. You find the pattern and process it with a loop.

Tags: