5 Replies Latest reply on Mar 25, 2009 8:02 AM by MikePR_1

    Do I need a global???

    Thicks

      Title

      Do I need a global???

      Post

      In my current datatbase I have form letters designed to print. In order to make this happen I set employeesID# as a global and made scripts that placed each employee's name that I listed in the case (obtained friom the employeeID#) into the letter.

       

      Example

       

      Employee ID = 12345

       

      12345 = John Smith

       

      _______

       

      Dear John Smith,

       

      blah blah blah

       

      However each employee has a six digit employee position number that tells me their managers name that I want to send a letter to. Right now when I have 2 employees with different managers it only prints a letter for the first employee position#.

       

      Example

       

      John Smith = position# 654214

       

      654214 = Manger (Kevin Jackson)

       

      Henry Wilson = position# 444222

       

      444222 = Manger (Kate Purue)

       

      Do I need to make my position number a global field like I have the employeeID# or what can I do????

       

        • 1. Re: Do I need a global???
          MikePR_1
            

          Thicks:

           

          What OS and FIleMaker version are you using?

           

          MikePR 

          • 2. Re: Do I need a global???
            MikePR_1
              

            Thicks:

             

            Globals are used to make a piece of information available to all records and they only work on relationships if you use them in the Main table not in the related table and they slow things down because you can not index a global field they only get indexed when they appear in the screen. So I think your use of globals probably is causing you trouble. Can you explain a little more the structure of the tables? 

            • 3. Re: Do I need a global???
              Thicks
                

              I have my main table where I collect my data and then I have an employees table that is related by the employeeID#. I also have a copy of this table that I have related to my employee# global. I have the position number in the data table and everything seems to work find except the position number to get the manager. Maybe the problem is with my script.

               

               

              My script has a counter and looks for the employee information and then loads it into the form letter layouts I have and prints it. It does not however seem to notice that the positions numbers for employees differ so it only prints the letter to the manager for the employee in position 1.

              • 4. Re: Do I need a global???
                MikePR_1
                  

                You are right, it's not going to change because the global is the same number for every record.

                 

                Why don't you take the copy of the employee table and make it a manager table with the main number being the manager number. That way you can create a relationship between the main table and the manager table using the manager number. The script doesn't have to do anything because the manager information can be accessed the moment you enter the manager number in the main table.

                • 5. Re: Do I need a global???
                  MikePR_1
                     i'm sorry, I forgot to suggest that you should change the manager number field from global to text;indexed in both main and managers tables.