AnsweredAssumed Answered

Adding child records in a loop

Question asked by WilliamDuncan on May 11, 2017
Latest reply on May 17, 2017 by fmpdude

This should be easy, but I haven't been able to apply the guidance I've been able to find. I've written a couple of scripts based on the samples I've found, but I couldn't get them to work right.


I'm using FM Pro 15 on a MacBook Pro running Sierra 10.12.4.


My database design is quite simple. I have questions that are used in a certification exam (Questions Table). I want to automate the process of recording which exams included each question (WhereUsed Table). The two tables are linked by QuestionNumber.


Once I've selected the questions for the exam (I do this by setting the ExamNumber field), I want to add a WhereUsed record for every question. The new records should be initialized with the QuestionNumber and the ExamNumber, both are which are available in the Questions Table.


I've been doing this by exporting records and then importing them. That works, but it's cumbersome.