Moving from 2 to N contacts per event

A place for users and developers of the Xataface to discuss and receive support.

Moving from 2 to N contacts per event

Postby gthorne » Mon Jan 14, 2013 4:25 pm

We've been using Xataface for a few months now for the backend of maintenance calendar, and it is working great. The main form has data that looks something like this:

event_id, //unique identifier
start_date,
end_date,
description,
tech_contact,
field_contact

And there's another table that has field_contact's and tech_contacts:
contact_id,
contact_name,
contact_email_addr

Now, my co-workers don't want to be tied to just one field and tech contact per event. Plus, they don't even care what kind of contact they are. I could do this:
event_id, //unique identifier
start_date,
end_date,
description,
contact_1,
contact_2,
...
contact_n

But that's really messy and not the right way to do it. According to the rules of db normalization, the right way to do this is to add an intermediate table to map event_id's to contact_id's.

relationship_id, //PK, not really used for anything.
event_id,
contact_id

But how do I show this relationship in xataface? What will this look like on the input form? Will I have to program a new control like a drop-down checkbox?

I hope my question makes sense.
gthorne
 
Posts: 32
Joined: Tue Jul 17, 2012 2:47 pm

Re: Moving from 2 to N contacts per event

Postby shannah » Thu Jan 17, 2013 9:01 am

You would create a relationship. Then if you wanted it on the input form, you could use the grid widget.

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 6 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved