Hi guys.
Is it possible in single form edit two table with relationship one-to-one (not one-to-many) without using subform?
So I have to table Orders and Waybill. Waybill have column waybill_order_id. I could use only one table with all columns form orders and Waybill but create two only for simplicity database logic.
Now I need Browse form with all Orders and then users will chose specific order they can edit this and edit fields from Waybill table.
Thank you in advance.
Maxim.
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.
One-to-one in single form
-
- Site Admin
- Posts: 2783
- Joined: Mon Jun 15, 2009 2:23 am
- nuBuilder Version: 4.5
- Been thanked: 3 times
Re: One-to-one in single form
Maxim,
The only way to do what you are asking is update the second table on After Save.
Steven
The only way to do what you are asking is update the second table on After Save.
Steven
-
- Posts: 42
- Joined: Thu Aug 09, 2012 8:52 pm
Re: One-to-one in single form
Steven
I have to use After Save for update or insert and changes to related table. Is it I right?
What should I do to display fields from related table in the form?
Must put some code in Before Open tab, searching record and then assign table fields to form fields.
For searching I can use #recordID# hash variables but how can I assign table fields to form fields?
Maxim
I have to use After Save for update or insert and changes to related table. Is it I right?
What should I do to display fields from related table in the form?
Must put some code in Before Open tab, searching record and then assign table fields to form fields.
For searching I can use #recordID# hash variables but how can I assign table fields to form fields?
Maxim
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: One-to-one in single form
Maxim,
you can put some code in Before Browse to build a temporary table.
Have a look here: http://forums.nubuilder.cloud/viewtopic.php?f=4&t=8094
Hope this helps.
you can put some code in Before Browse to build a temporary table.
Have a look here: http://forums.nubuilder.cloud/viewtopic.php?f=4&t=8094
Hope this helps.
-
- Posts: 84
- Joined: Mon Jul 04, 2011 12:52 am
Re: One-to-one in single form
There is a object type Display.What should I do to display fields from related table in the form?
In SQL to Display u can use hash variables.
example:
SQL to Display: SELECT field_name FROM table WHERE forign_key='#recordID#'
will populate the display field with 'field_name' (if the result is found)
-
- Posts: 42
- Joined: Thu Aug 09, 2012 8:52 pm
Re: One-to-one in single form
Hello, zazzium
Is it possible do something with Text object like you describe with Display object?
Text object has "Default Value SQL" but after I place here my SQL nothing happens.
I think it's more elegant way load necessary data from relating table, user can change them in form and then update data in After Save page.
But how can nuBuilder load data to editable field (Text field not Display field)?
Maxim
Is it possible do something with Text object like you describe with Display object?
Text object has "Default Value SQL" but after I place here my SQL nothing happens.
I think it's more elegant way load necessary data from relating table, user can change them in form and then update data in After Save page.
But how can nuBuilder load data to editable field (Text field not Display field)?
Maxim
-
- Posts: 84
- Joined: Mon Jul 04, 2011 12:52 am
Re: One-to-one in single form
Maxim,
If u want the field to be editable, then the easiest way is to use subform (even for one field).
One other possibility would be.. to make Dispaly field which gets the data u need. Then add a Text field.
Hide the Display field (Display Condition: SELECT 0) and give the Dispaly value to the Text field with javascript.
After Save u can send the Text field value where u need to.
If u want the field to be editable, then the easiest way is to use subform (even for one field).
One other possibility would be.. to make Dispaly field which gets the data u need. Then add a Text field.
Hide the Display field (Display Condition: SELECT 0) and give the Dispaly value to the Text field with javascript.
After Save u can send the Text field value where u need to.
-
- Posts: 42
- Joined: Thu Aug 09, 2012 8:52 pm