2 Replies Latest reply on Dec 27, 2011 4:17 AM by sulu762

    Batch Entry Using Script and Global Fields

    sulu762

      Title

      Batch Entry Using Script and Global Fields

      Post

      Mac OS X 10.5

      FMP 10 Advanced (Beginning User)

       

      Tables:

      Personnel

      LeaveComp

       

      They are joined by a unique personal ID #.

       

      Layout 1 lists all the employees as listed in the Personnel table.

      Layout 2 records all individual leave and comp time accrued and used.

      Layout 3 is where I would like to batch enter vacation time accrued or used and it shows information from the Personnel table.

       

      In the header of Layout 3, I have global fields that contain the data I would like to batch enter:

      LeaveComp::g_AccruedorUsed

      LeaveComp::g_NumDays

      LeaveComp::g_Notes

       

      and in the body, I have the list of employees names with a checkbox labeled “No”.

       

      I would like to push one button that will record all global data (for employees where the “No” checkbox is unchecked) into Layout 2 where the field names are the similar to the global fields (sans "g_" prefix):

      LeaveComp::AccruedorUsed

      LeaveComp::NumDays

      LeaveComp::Notes

       

      Currently I have a button beside each of the names where the user must click it to add the record, however I’m trying to make it easier by the use of only one button.

       

      I’ve searched the forums, however I don’t know the correct keywords to get the correct answer.

       

      Any help would be appreciated. 

      Cheers!

        • 1. Re: Batch Entry Using Script and Global Fields
          philmodjunk

          Take a look at Replace Field Contents with the calculation option.

          If your 3rd layout specifies LeaveComp in Show Records from in Layout Setup..., you can use three Replace Field Contents operations to copy the data from the global fields into the matching non global field for all records currently in the found set. Replace Field Contents can be done manually and also via a script.

          This is not something you can Undo and it can modify hundreds of records in one go, so make back up copies before testing this method.

          • 2. Re: Batch Entry Using Script and Global Fields
            sulu762

            PhilModJunk,

            Thank you for the reply.  I will try and play with the Replace Field command and report back my progress.

            Happy New Year.