AnsweredAssumed Answered

Make a script that creates a new record in a specific table with data pulled from other tables

Question asked by JamesClark on Nov 29, 2010


Make a script that creates a new record in a specific table with data pulled from other tables


I'm building an equipment loaning database, I'm new to filemaker and new to database design. I've begun building a database from scratch because I found the starter solutions very difficult to edit. I've had some help with this so I think it's on solid grounds but now the person that was helping me doesn't seem to be posting anymore.

A copy of the database is here does anyone feel like helping me? If anyone wants to check out the database and help me the only user is: Admin and the password is: passw0rd. There are only dummy records and only a few of them but I hope it helps you get the gist of what I'm trying to achieve.

I currently have a tables of users, inventory, kits and loans. Inventory is the equipment being managed by this loans database, and kits is a specific table for when people borrow a bag or kit of pieces of equipment, so borrowing several items all belonging to one kit, at once. The Users table is, well, users and loans is a table which is used for gathering data to keep a record of which users are borrowing what equipment and a log of their previous loans.

At the moment the database can be used to enter records of inventory items and records of users, there is only one filemaker user account used for this which is for the administrator, the administrator alone can create, edit and delete new users but anyone can create, edit or delete items of equipment and kits.

The part I'm working on now is making the 'check out' button in the catalogue view of the inventory layout execute a script that will:

1. Create a new record using the fields from the 'Loans' table

2. Take the value of the 'condition' field from the specific record of a piece of equipment being checked out and insert this value into the 'condition out' of the newly created 'Loans' record

3. Change the 'Loan status' field of the specific record of the piece of equipment being checked out to 'checked out' and insert this value from the value list to the corresponding 'Loan status' field of the Loans table record being created.

4. Take the 'NameFull' field of the current user, and insert it into the corresponding field in the 'Loans' table record being created.

I may run in to trouble here because being unfamiliar with Filemaker pro I haven't got any experience with user accounts, with the help I received an Admin account was created and I can see that new users are created as records by the Admin in the users - edit layout. I don't know though, how I can make a user a 'current' user, like how to make a record of one user be used as the record from which the 'NameFull' field data will be extracted and inserted in to the Loans record.

I'm sure there's some important details I've missed but I really hope somebody can help me.