November 17, 200421 yr Newbies I have two databases. 1.client address book which has a customer ID which is a auto serial number field. 2.Is a contract database.I have defined the relationship between the two databases using the customer ID. Every time I enter a new record I want another field to generate a "Contract Number" According to how many contracts are there for that customer. Can anyone please help?
November 17, 200421 yr Hi Checkout this template! http://www.filemakerpros.com/Serialize_by_Category.zip --sd
November 17, 200421 yr This can be done by a script starting in db1 "client address book". I assume you have a field in db2 "contract" "Contract Number". I assume the relationship is named "Contact" In both db's add a calculated number field "Constant" = 34567 or any othe number that you like. Make a relationship in db2 to db1 using "Constant" as the key fields. Call it "Client". In db1 add the following fields Last Contract Number a calculated number = Last (Contact: Contract Number), gcustomer ID a global field of the same type as customer ID and gContact Number a global number field. In db1 write a script to create a related record: Set field [gcustomer ID, cusomer ID] Set field [gContact Number, Last Contact Number + 1] Perform script "New record" in db2. In db2 write the "New Record" script Create new record Set field [customer ID, Client::gcustomer ID] Set field [Contact Number, Client::gContact Number] You then can enter data into this record. You may want to add a script & button to go to db1.
Create an account or sign in to comment