6 Replies Latest reply on Sep 11, 2015 9:41 PM by erolst

    Duplicating a set of records and loop

    VictorWarner

      I am new to Filemaker and particularly scripts.

       

      I would like to duplicate a set of records which I have found used Find. From searches on the internet I know I need to use a script and the loop command.

       

      The database has 4 fields:

       

      Serial Number, Name, First name, Record Number.

       

      I find a set of records based on the Name field, and say returns 4 records and I wish to duplicate all of them.

       

      The script is a follows:

       

      Go to Layout [ “Layout #2” (TableTable) ]

      Show All Records

      Go to Field [ TableTable::Name ]

      Enter Find Mode [ ] [ Pause ]

      Perform Find [ ]

      Sort Records by Field [ Ascending; TableTable::Name ]

      Go to Record/Request/Page

        [ First ]

      Loop

        Duplicate Record/Request

        Go to Record/Request/Page

        [ Next; Exit after last ]

      End Loop

       

       

       

      The above script only duplicates the first of the 4 records.

       

      The examples I have seen from my searches seem too complicated for my simple needs.

       

      I would be grateful for any help.