Skip to Main Content
  • Questions
  • Want to implement multiple address functionality

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Tushar.

Asked: November 03, 2020 - 5:58 am UTC

Last updated: November 04, 2020 - 3:32 am UTC

Version: 20.1

Viewed 1000+ times

You Asked

Hi,
I am creating a user sign up form in which I want to add multiple address option so that user can enter multiple address and select one as a default one. Can you please help me with this?

and Connor said...

This sounds like a standard master-detail to me

https://docs.oracle.com/database/apex-18.1/HTMDB/managing-master-detail-forms.htm

where

Master = person
Detail = addresses

with a column on your addresses table indicating "default".

To ensure only a single address can be marked as default, you can create a function-based index.

create unique index MY_INDEX on ADDRESSES ( case when default = 'Y' then person_id end )


Is this answer out of date? If it is, please let us know via a Comment

More to Explore

APEX

Keep your APEX skills fresh by attending their regular Office Hours sessions.