Page 1 of 1

Object for 1:1 relation

Posted: Thu Jun 07, 2012 9:49 pm
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.

Re: Object for 1:1 relation

Posted: Fri Jun 08, 2012 3:25 am
by shane
- 1:n relations require a subform

Re: Object for 1:1 relation

Posted: Fri Jun 08, 2012 10:27 pm
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.

Re: Object for 1:1 relation

Posted: Tue Jun 12, 2012 1:44 am
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

Re: Object for 1:1 relation

Posted: Tue Jun 12, 2012 5:05 pm
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?

Re: Object for 1:1 relation

Posted: Wed Jun 13, 2012 5:29 am
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.