ritmark Posted April 25, 2003 Posted April 25, 2003 I am not new to programming or scripting, but I am new to filemaker, and this script seems over my head. I am hoping someone out there will be nice enough to help me create it. This is the basics of what it must do. The database is of Users, the other databases used are a Groups database, and a Memberships database. The script will run in the users database, and use the other 2. In the Users database, you select what groups you belong too, then in the memberships database, i need it to create a record for each group you select. the record consists of an auto-enter number, User_Number, and Group_Number. To further complicate things, in the user database, they select they Name_F from the groups database. I have to make the script search the Groups database, using this Name_F, to get the Group_Number. thanks a million, I really hope someone has a kind heart, and a large brain. --Mark --Rush-Henrietta Central School District --Computer Services
Peter Fenner Posted April 25, 2003 Posted April 25, 2003 I am sure this shouldn't be too hard but I can't fully get the gist of your question. If you could provide more clarity then you will get the answer you are looking for. Pete
ritmark Posted April 25, 2003 Author Posted April 25, 2003 Yes, I applogize for the confusion. i will go in depth, even if its too in depth. The interface is all in the User Database, the user enters a user number, all their personal information, and selects from a series of dropdown lists, what groups they belong too. When everything is filled out, they click a button that says create user. I want to script on the button to make a record in the Memberships database for every group that that User belongs too. The 3 fields in the membership are membership_number, which is just an auto-incremented number, user_number, which is from the User database, and group_number, which is in the groups database. When the user selects a group from the dropdown menu, it is a valuelist from the groups database. It is using the field Name_F though, not group_number. Because of this, I have to find a way to perform a find, using the Name_F, and then get the group_number from there, to use in the creation of the memberships database. This is still realy confusing i'm sure, but it should be much more clear then my original post. If you have any specific questions, i would be glad to clear it up even more. So far, I have a script on the button, "Create User" that opens the membership database, and runs a script, called "new record". That "new records" script is located in the memberships database, and does just that, creates a new record. I think that alot of the code will go in this script, not just the "Create User" script. Thank you so much, Mark
Peter Fenner Posted April 25, 2003 Posted April 25, 2003 Hi Mark I am sure you are being clear, maybe I am missing the crux. What is Name_F. As this a new user their name will not be in the groups database yet. Right?
cjaeger Posted April 25, 2003 Posted April 25, 2003 what do you need the membership database for? you can have a user belong to multiple groups (relation users->groups, key=group ID) while group id is a textfield in users formatted as checkbox with value list of possible groups . then have a relation back from groups to users using the same keys. the valuelist "groups" is made from fields groupID and group Name in Database "groups". well, have a look at the attachment ... users_and_groups.zip
ritmark Posted April 25, 2003 Author Posted April 25, 2003 In reply to Name_F, this is used as the full name of the group. The memberships database is used to keep track of user_number and group_number pairs, but in the groups database, we use name_F to keep track of all the groups. This is simply the full name of the group. Such as Administration, or Computer Services Secondly, that is exacty what i use the membership database for, so i suppose i dont need it. All it does is keep track of user_number/group_number pairs, to see what groups the user belongs too. Just to stop from going back and changing tons and tons of code, I think I will keep it the way I have it, unless its impossible to do this script. Thanks for the cool advice though =]
ritmark Posted April 25, 2003 Author Posted April 25, 2003 With my current scripts, i can open the Memberships database, create a new records, and have it autofill in the Membership_Number. The User_Number and Group_Number fields are very confusing to me, because you get the results from other databases. How is this done? Using relationships and similar fields? --Mark
ritmark Posted April 25, 2003 Author Posted April 25, 2003 I'm stuck now. I just cant figure out how to set a field in one database, using a field from another.
cjaeger Posted April 25, 2003 Posted April 25, 2003 just have a look at the yellow layouts in the 3 files. You will easily see the problem of duplicate records when using an external join file (membershp) users_groups_members.zip
Recommended Posts
This topic is 7886 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