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!
Welcome to the nuBuilder forums!
Please register and login to view forums and other content only available to registered users.
Please register and login to view forums and other content only available to registered users.
Relation n:m in nuBuilder
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
-
- Site Admin
- Posts: 2781
- Joined: Mon Jun 15, 2009 2:23 am
- nuBuilder Version: 4.5
- Been thanked: 1 time
Re: Relation n:m in nuBuilder
massiws,
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
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
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Relation n:m in nuBuilder
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: 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.
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: 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.
-
- Site Admin
- Posts: 2781
- Joined: Mon Jun 15, 2009 2:23 am
- nuBuilder Version: 4.5
- Been thanked: 1 time
Re: Relation n:m in nuBuilder
massiws,
I'm not exactly sure, but do you know how to use this bit (Update other Fields)..?
Steven
I'm not exactly sure, but do you know how to use this bit (Update other Fields)..?
Steven
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Relation n:m in nuBuilder
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!
Thanks.
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!
Thanks.
-
- Site Admin
- Posts: 2781
- Joined: Mon Jun 15, 2009 2:23 am
- nuBuilder Version: 4.5
- Been thanked: 1 time
Re: Relation n:m in nuBuilder
massiws,
I understand now but nuBuilder has no way of doing what you need (at the moment).
Steven
I understand now but nuBuilder has no way of doing what you need (at the moment).
Steven
-
- Site Admin
- Posts: 2781
- Joined: Mon Jun 15, 2009 2:23 am
- nuBuilder Version: 4.5
- Been thanked: 1 time
Re: Relation n:m in nuBuilder
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
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
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Relation n:m in nuBuilder
Steven,
you're working hard, and this is greatly appreciated!
I'll try the new feature as soon as it's available.
Thanks lot.
you're working hard, and this is greatly appreciated!
I'll try the new feature as soon as it's available.
Thanks lot.