Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

multiple addresses for contact database


This topic is 6982 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I'm building a contact database from scratch that will allow me to enter as many address as I want for a particular contact by storing them in a separate table and using a one-to-many relationship between Contacts and Addressess. Entry and viewing of addresses are with a portal on the Contacts layout.

Here's the problem. I have two requirements for how this should work. If only 1 address is entered, I want this to automatically be set as the 'Primary Address' (without the user having to do anything besides enter the address). However, if there is more than 1 address for a particular contact, I want to be able to choose an address to 'set as primary.'

I can accomplish the first requirement with a calcuation/lookup and the second requirement by attaching a script to a button that goes to the related record, copies the necessary info to globals and then to the Primary Address field in the Contacts table. But I can't figure out how to do both things together.

I was experimenting with including an 'IsPrimary' field in the Addresses table that defaults to 1 and then using a script for multiple addresses to set the desired primary address to 1 and the other related addresses to 0. But then I can't figure out how the get that address info back into the Contacts table using a calculation.

Any help would be greatly appreciated. I can post the file if necessary. I'm working in FMP7 on MacOSX.

Thanks,

Philip

Posted

Philter:

Welcome to the Forums.

Examine the FileMaker Business Tracker, which works the way you are describing. It's available as a free download from FileMaker.

-Stanley

  • Newbies
Posted

Hi Stanley,

Thanks for the tip. I did look at that, but it was way too complicated for my intermediate skills. I think what I'll end up doing is just using a second single row portal to display the primary address and have it sort by IsPrimary. Then I'll use the data entry portal with a script to change the IsPrimary number accordingly.

Hopefully, when it comes to mailing labels I can figure out how to grab the right address, but I haven't gotten that far yet. :

Philip

Posted

I have been looking at your original post. The following might work for you. Add an extra IsPrimary field as you suggessted but let it Auto-enter a zero. In the relationship sort the address table by IsPrimary descending. If you select one address and change IsPrimary to 1 then that address will be the first related record. If there is only one address you can change IsPrimary to 1 if you wish but it will work just as well with IsPrimary left as the default zero.

With this sorting the first address in the relationship will always be the Primary address (if you have chosen one) and then that will turn up whenever you put the related address field onto a contact layout, label layout etc. There is no need to transfer this address into your contacts database.

  • Newbies
Posted

SlimJim,

Thanks for your input. I see your method would work too. I guess I was just thinking of always having the primary set to 1 for consistency.

But thankfully, I was able to get around my problem of displaying the primary pick by just displaying it another portal instead of trying to copy it. Sometimes just typing out the problem and asking for help stimulates new ideas!

Philip

This topic is 6982 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.