Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Object for 1:1 relation

Locked
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Object for 1:1 relation

Unread post by massiws »

Hi,
can someone help me, please?
I have 3 tables like this:
table: call
- cal_id
- cal_name
- cal_address
- cal_ass_id
...

table: assistance
- ass_id
- ass_sup_id
- ass_data
...

table: suppliers
- sup_id
- sup_name

The relations are:
- 1:1 between cal_ass_id and ass_id
- 1:n between ass_sup_id and sup_id

I created a form to view and edit all data from call and assistance tables, but have not been able to retrieve data from the suppliers table.
What kind of objects nuBuilder should I use to get, for example, the sup_name value? :?:
If I use a select inside another select it doesn't work... :(

Any suggestion will be appreciated.
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: Object for 1:1 relation

Unread post by shane »

- 1:n relations require a subform
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Object for 1:1 relation

Unread post by massiws »

shane wrote:- 1:n relations require a subform
That's ok, and 1:1 relations?
I have to display and modify data from two table relationated 1:1: what type of object I have to use?

Thanks for your time.
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: Object for 1:1 relation

Unread post by shane »

Normally a form is associated with a single table that the edit screen will be used to edit a single record in that table.
You have as many inner joins however on the browse screen but the edit screen is built around a single record of the main table.
You can still us a subform if you need 1:1 or 1:n records for the main record, but you can also put the fields on the screen and use 'AfterSave' to do a manual INSERT/UPDATE
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Object for 1:1 relation

Unread post by massiws »

Ok!
Thank you, shane, to spend your time in reply! :D

May you tell me if the use of MySQL-Views is supported by nuBuilder?
If I build a view in MySQL with all the necessary tables, fields and join, can I treat it as a unique table in nuBuilder?
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Object for 1:1 relation

Unread post by admin »

massiws,

I'm not sure how well editing Views will work with nuBuilder, but there is no automatic way nuBuilder will add records to a View.

If it can be done it would only be by manually adding records on Before or After Save.

Steven.
Locked