AnsweredAssumed Answered

Create Records Automatically from Related Table

Question asked by ClaireCollin on Apr 23, 2013
Latest reply on Apr 25, 2013 by philmodjunk

Title

Create Records Automatically from Related Table

Post

      

     I am trying to have my database create new records in a table related to my initial table which is created with a raw data import.  I think I need to use a script however, I am not familiar with scripting and it seems a bit confusing to me.  I saw the post below and tried to follow it but I am not sure I am undertstanding what the $K means or if this script works with Filemaker Pro 11 because I can't seem to make the 3rd step. Can you explain this method in more detail?

Previous Post: Create and populate records automatically July 22 2012

The system will need to know how many records to create and any other data such as a value in a foreign key field that might need to be entered into each new record.

     Define a global field and put it on a layout or use it as an input field with Show Custom Dialog so that the user can enter a number into it.

     I'll refer to it in this script as Globals::gNumRecs

     Loop
        Set Variable [$K ; value: $K + 1]
        Exit Loop If [$K > Globals::gNumRecs ]
        New Record/Request
        Set Field [YourTable::SequenceField ; $K ]
     End Loop

     Add additional set field steps at the end of the loop if there is other data to enter into the new record.

      

Outcomes