Newbies shurum Posted March 28, 2007 Newbies Posted March 28, 2007 Hi, i am using FM Adv 8.5, in a network. i need to creat a new record (like a new invoice) and provide it with a new number as a result of a given parameter. in my case the use of the built in function "next serial number" is not possible because the numbers are not always consecutive. i use a GLOBAL field in the file, into it a script sets the last value after each time i create a new record. and a field for the RECORD NUMBER. when a new record is created - the script goes to that RECORD NUMBER field and Set the new record number as: record number = Last GLOBAL + 1. then it sets the global field as last GLOBAL = GLOBAL +1. the problem: the script works fine when only one user is working. when more then one is working - (using open remote) the numbers do not synchronize. the use of global variables did not help either. the script does not seem to function in the network. Any help and advices will be appriciated. thanks, shurum
Inky Phil Posted March 28, 2007 Posted March 28, 2007 Hi Shurum and welcome to the forums If I have understood you correctly the problem is that you have stored your required number in a global field. Global fields are not only one value for all records but they are specific to each user ie each user can have their own data, different to any other user, in any global field. This is one of the strengths of global fields and makes them a very powerful tool to have in your box but it does mean that they cannot be used to store details across a multi user solution as you have found. The way round this might be to set up a table with a field to hold the next/last invoice number. You can relate this by setting up a constant (x-type) relationship to all tables that might reference this data thereby making it available to all users HTH Phil
Recommended Posts
This topic is 6511 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now