Page 1 of 1

Relation n:m in nuBuilder

Posted: Tue Sep 11, 2012 11:39 am
by massiws
Hi,
I have some dubts working on a new project about technical manitenance and hope someone can give me some suggestions.
I have two table appointment and technician with relation n:m, so one technician can have zero or more appointments and one appointment can be fixed for one or more technicians.
In database I set three tables:

appointment
- app_id
- app_apt_id
- app_data
- app_time

technician
- tec_id
- tec_apt_id
- tec_name

appointment_technician
- apt_it
- apt_app_id
- apt_tec_id


When users insert a new appointment should have the possibility to assign one or more technician to that work, so I think to use appointment as primary table and technician in the subform.
In another form I can show all the appointments of a technician by placing a subform-appointmens on primary-technician-form.
Am I right?
The appointment_technician table must be managed by custom code in AfterSave tab or there are some shortcuts?

The second question in relative to app_time field in appointment table.
Can I insert a new format time that can be selected from the available formats in object format field on text tab?

All suggestions are welcome!

Re: Relation n:m in nuBuilder

Posted: Wed Sep 12, 2012 6:43 am
by admin
massiws,
Untitled11.png
This is the best way to make it work..

A is the Form
B is the Subform with C a Lookup in the Subform.

In both cases the Subform is appointment_technician which means appointments and their technicians can be added and viewed from either Form.

Steven

Re: Relation n:m in nuBuilder

Posted: Sun Sep 16, 2012 5:24 am
by massiws
Steven,

thanks for answer: following your suggestion and working on it two days I get good results, but one thing I haven't be able to solve.

Please, have a look at this image:
snapshot.png
When I add a new record in appointment (Appuntamenti) is possible to get the number in Num Intervento from the request table to auto-fill the corresponding field in appointment_technician table (number 4 in the image above)?

Following the wiki, I tried to put some code in AfterBrowse and BeforeOpen of appointment form, but I can't get any value..

Thanks.

Re: Relation n:m in nuBuilder

Posted: Mon Sep 17, 2012 8:04 am
by admin
massiws,

I'm not exactly sure, but do you know how to use this bit (Update other Fields)..?
Capture.PNG
Steven

Re: Relation n:m in nuBuilder

Posted: Mon Sep 17, 2012 9:51 am
by massiws
Steven,

yes, I know how to use lookup fields, but my answer was another.

If I have a formA with a browse-subform subformB inside, when I press the Add new record in the subformB it opens a formC.
I want to take one parameter from formA to auto-fill a field in the new record in formC.
In other words, how can I refer one field on a main form from a browse subform?

Following your wiki "Subform Properties for version 2.6", I can insert a new invoice directly from the browse-subform pressing Add record button.
But how can I fill the Customer code field in the new record taking the value from the corresponding field displayed in Customer form?
When you open a new record from a browse-subform, which variables still contain values from the main form?

Excuse my awful English! :oops:
Thanks.

Re: Relation n:m in nuBuilder

Posted: Mon Sep 24, 2012 3:54 am
by admin
massiws,

I understand now but nuBuilder has no way of doing what you need (at the moment).

Steven

Re: Relation n:m in nuBuilder

Posted: Tue Sep 25, 2012 1:00 am
by admin
massiws,

Actually you will be able to do it in the next release.. (v2.7.4.8)

This is how it will work.. http://www.youtube.com/watch?v=6d_nYErMGPI

Steven

Re: Relation n:m in nuBuilder

Posted: Wed Sep 26, 2012 6:00 pm
by massiws
Steven,

you're working hard, and this is greatly appreciated!
I'll try the new feature as soon as it's available.

Thanks lot.

Re: Relation n:m in nuBuilder

Posted: Thu Sep 27, 2012 4:14 am
by admin
.