Newbies AlphaBravo Posted April 16, 2009 Newbies Posted April 16, 2009 Hello all, I'm having trouble with record creation via portals and was hoping someone may be able to lend some pointers. There are Contacts, Companies, and then many things that each can have and share such as Phone Numbers, Addresses, Fax Numbers, etc. Contacts should also be able to relate to Companies as well. I've created a large join table called Lookup that can hold all the foreign keys of each related primary key in the other tables. I want new records in Lookup created to tie them together, which works 'half way'. If I add a Phone Number from the Contact layout in the Phone number portal, a new record should be created in Lookup with the two ID's. When the phone number is deleted, the Lookup record should be deleted. Same thing for Fax, Address, etc. This all works, however, the Lookup record creation is two liberal. What I want is one record created for each relationship, for example in each Lookup record only two ID fields will be filled in. What is happening unfortunately is that as more records are added via portals, sometimes a new record is created and sometimes foreign key data is added to Lookup records that already exist. This is the problem. So in that case if there is one Lookup record tying a Contact, Address, and Fax Number together and then if the Fax Number is deleted via the portal, the link between the Contact and Address is now lost as well. I want a new Lookup record created for each relationship instance. I can't determine the logic governing why sometimes a new record is created and sometimes not. I have attached my file to see if that sheds some light. Thanks for your help! Contacts.zip
Tpaairman Posted May 13, 2009 Posted May 13, 2009 (edited) I'm still tinkering with this one, but here's what I have come up with so far. First of all, your relations are set wrong. Go to you relations, and in each of the lines connecting the tables is a box. You need to (one at a time) double click on the box, and on the left side, bottom half, you have them checked to delete the record. Uncheck that. That side of options is what to do with Lookup records. So when you delete a fax number, you are telling Filemaker to ditch the lookup record too. So for all the tables that have info (address, fax, etc) uncheck that delete box. With this set, you don't need to have multiple Lookup records for one Contacts record. And it won't matter if you use the same Fax# record for more than one Contact - they won't affect each other. Secondly, I'm not sure why you are using portals in the contacts page. If you only will have one record for each contact (i.e. only one fax number, only one phone number) you don't need the portals. You can set a new field on your layout. In layout mode look on the right and you will see Fields with an arrow - click and HOLD on fields, and you will see a gray outline pop up to the right of Fields- now just drag it to where you want it. After you place your field, a box will pop up with the list of fields from your table. Above the list is a drop down menu that says Current table - just change it to your relation, and in the new list of fields, select the field you want to show. But, before you go and do all of that, just go into your existing file that you have, click on the portal itself, and hit delete. The portal will be gone, but your fields will remain. So use the above info about adding fields for future fields. Lastly, I think you are not fully understanding what portals are for. As I said above, you don't need a portal to show related info. Portals are meant as a list of multiple related records. In other words, if you had several phone numbers for that same contact list, and you needed to see the list of phone numbers that go with it, then it's time for a portal. Edited May 13, 2009 by Guest
Recommended Posts
This topic is 5673 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