1 Reply Latest reply on Aug 5, 2013 11:06 AM by philmodjunk

    Storing a global number with Server

    MichaelHarding

      Title

      Storing a global number with Server

      Your post

           Hello

           I am trying to come up with a solid way to generate a sequential number that updates on the start of a new fiscal year.

           Currenlty, I have a Jobs database that generates a new sequential number for every new job file a staff member opens.  For example, 12-255.  The Job number field is just a calculation joining two other felds:

           Job_Number_1 -the first two digits (12) is the fiscal year - it is a global field

           Job_Number_2 -  the last three numbers  are an auto-generating serial number starting from 001

           I wrote a script that will check the current date and recognize the first day of our fiscal year.   The idea is to change the two fileds so that the next job file open will get the job number 13-001.  The script ran on schedule and the second part of this number was successfully changed.   Job_Number_2 was set back to 001.  However the global field Job_Number_1 did not advance to 13 as I had hoped.  I now understand how global fileds behave across a server, so I get why this won't work.   My question is, what is the best way to accomplish this?

           I am using Filemaker Pro Advanced 11 and Filemaker Server Advanced 11

           Thank you

            

        • 1. Re: Storing a global number with Server
          philmodjunk

               Did you trying running this script from a server schedule? Changes made to a global field from a client session are not retained. Changes made to a global field from a host session should be retained--but the changes will not appear on client systems until they clsoe and re-open. Sever scheduled scripts run in a Host context and thus changes to a global field should be retained.

               The alternative is to store the value in a non-global field instead of a global one. Often, the values in global fields are actually kept in non-global fields and the global fields are initialized via a start up script when a client opens the file. That way, permanent changes can be made to the global field by changing the non global field from which it is initialized on each start up.