1 Reply Latest reply on Jul 22, 2012 10:58 AM by philmodjunk

    Create and populate records automatically

    cjmj

      Title

      Create and populate records automatically

      Post

      I need to create n records together and populate them with a numeric series, but I don,t want to do do it record by record.

      How can I create and populate it automatically?

      Thanks

        • 1. Re: Create and populate records automatically
          philmodjunk

          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.