Newbies AlanBell Posted June 30, 2001 Newbies Posted June 30, 2001 Hi, I am fairly new to Filemaker (5.5) so would appreciate a bit of help. I am trying to turn a flatfile contact db into a relational one. My problem is as follows: I have a master file/record (Record # and Account Name, primary address, phone etc.). Within each record I then have multiple contact details. However these contacts may not be located at the primary address. In some instances there can be up to 15 "sub-" offices and I want to be able to enter a contact name (on a contact layout) and show the specific address they're located at as a field underneath each one. The logic I'm following is to create a child database with these 15 sub-addresses (Record # and Customer name being the matchfield) and to show them in a portal (in a seperate "sub-addresses layout) which is linked to from the primary contacts screen. I then want to be able to click on one of these sub-addresses and copy it across to the primary contacts screen in a field underneath the specified contact... Then do the same for the next contact (who may be at a different address) and so on... I seem to be able to manage to work out a script for the first contact and can select from the portal (though I can't work out the Go to Portalrow command, or the insert record number symbol, so use buttons instead). However, to do the next contact this approach means that I would need to create another layout and copy all the addresses across again - I'd end up with 15 layouts!!! I have thought of setting a couple of global fields; one to mark which contact/sub-address field I want to paste the address into, and one for the portal row. I thought I could use these to try and run a loop. Can't work this one out either... Does anyone have some suggestions? Your help would be gratefully rec'd. Regs
LiveOak Posted July 1, 2001 Posted July 1, 2001 I'm a little confused about what you are doing. The purpose of using a related file is not to have to copy any addresses! The main file would store the customers name and primary address. The related file stores each additional address, which should be unique and not require any copying. I would an auto entered, can't modify record number in your main file to create the relationship with the related file. If you use the customer name, a later correction of a incorrect spelling could disconnect all the customers addresses in the related file. I have no idea why you think you need multiple layouts??? All you need to do to display the selected portal row is to create another relationship from a global number field in your main file to an an auto entered recordsID field in the related file. Call the global field gSelectedContact. Place the related name, address, etc. fields using this new relationship on the layout in your mail file. Put a clear box over the portal row and attach a script. The script copies the related RecordID to gSelectedContact. This causes the related field you placed on the layout to display information for the selected contact. -bd
Recommended Posts
This topic is 8551 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