AnsweredAssumed Answered

Dynamically assigning database fields to layout objects?

Question asked by techxedu on Oct 11, 2015
Latest reply on Oct 14, 2015 by user19752



Thanks to the assistance I've received here in troubleshooting object slide feature, I think I have a draft of a report template. My volunteer project using FMPv12 is student report card so my goal is to have a PDF for each student which is a record in the FMP database.


While searching the knowledgebase I saw one article that pointed out the "ObjectName" property. I'm not quite sure how to address an object by that property in a script yet but at least made sure to name each object I place on the layout with unique names using the Inspector (Inspector -> Position tab -> Name property): "classnameobj", "overallgradeobj", "subcategory1gradelabelobj", "subcategory1gradeobj", etc. etc. Some classes have a subcategory grade on top of overall grade while some don't.

I've also made sure that fields in the student database contains sequential numbers for field names: "class1name", "class1overallgrade", "class1subcategory1gradelabel", "class1subcategory1grade", class2name", "class2overallgrade". etc., etc.

Above in the hopes that I can dynamically assign database fields to layout objects while looping through all classes a student takes (i.e. a record contains these). Pseudo code of what I'm thinking is like this:


for x = 1 to report.card::NumberofClasses



for y =1 to 5

     if reportcard::classxsubcategoryygradelabel <> NULL then




next y

next x


Is above doable in FMPv12's scripting? I just wanted to make sure I'm on the right track. If not I'll have to just make the template 10 times longer and larger (if there are 10 classes a student takes) and not dynamically assign the database fields to layout objects but use the "Specify Field" that pops up when you right-click a layout object instead. In all honesty I'll rather dynamically assign through scripting language if version 12 has these capabilities because the template will also be short & sweet.


Thank you,