Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

multiple addresses for contact database

Featured Replies

  • Newbies

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

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

  • Author
  • Newbies

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

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.

  • Author
  • Newbies

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

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.