1 Reply Latest reply on Nov 17, 2011 10:10 AM by philmodjunk

    Need a help with auto creating new records

    CarolineU

      Title

      Need a help with auto creating new records

      Post

      Hi

      Just wonder how to create new record for example 52 times without doing it manualy.  I'm using file maker template 'task management' to schedule work on different project.  Project are divided into taskwhich are taking place from once a year to 52 times a year.

      Example:

      Project 'X'

      task 1 - bi monthly

      task 2 - 6 monthly

      task 3 - weekly.

      I wonder how to create related to the project tasks multiple times which will depend on their frequency.

      The reson why would i like to have 2 records for task 2 or 52 for task 3 is to enable me to assign specific task to specific people, dates etc.

      Knowing me it's going to be something simple and i just try to complicate my life.

      Anyway...

      Many Thanks

       

      C

        • 1. Re: Need a help with auto creating new records
          philmodjunk

          presumably you have a relationship similar to this. (I'm not looking up the actual table and field names used in the starter solution, so you'll need to adapt this example as needed.)

          Projects::ProjectID = Tasks::PojectID

          Presumably, you've added a field for the yearly frequency needed for a given set of task records. We'll call it Frequency.

          #Script should be performed from a layout based on Projects
          Set variable [$ProjectID ; value: Projects::ProjectID ]
          Set Variable [$I ; value: case ( Projects::Frequency = "bi monthly" ; 24 ; Projects::Frequency = "6 monthly" ; 2 ; Projects::Frequency = "Weekly" ; 52 ) ]
          Go To layout [Tasks]
          Loop
             Exit Loop If [$I < 1]
             New Record/Request
             Set Field [tasks::ProjectID ; $ProjectID]
             Set Variable [$I ; $I - 1]
          End Loop
          Go To layout [original layout]

          There are several other methods possible, including a related table, that can be used to specify the number of tasks to be created.