Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Subform not saving new record
-
- Posts: 68
- Joined: Sun Mar 04, 2018 6:38 pm
Re: Subform not saving new record
none. Does that mean the form's object list is not used to create the query?
TonyD
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: Subform not saving new record
Not sure about that. I haven't examined the saving part of the source code thoroughly.tonyd wrote:none. Does that mean the form's object list is not used to create the query?
Another thing to check: Search the Objects Form for duplicates of mattersid.
-
- Posts: 68
- Joined: Sun Mar 04, 2018 6:38 pm
Re: Subform not saving new record
FIxed!
I found out you cannot include the foreign key field in a subform that uses an Input:file object because the system already takes care of updating that field. By including the foreign key in the browse subform, I was creating the duplicate SQL field. FYI, nuBuilder creates the SQL statement in nuUpdateDatabase() at line 201 of nudata.php. Here the system has already taken care of the record ID and the foreign key of the subform, then it finishes building the SQL statement for the update. If you include the foreign key in your browse subform, it will create it twice. For some strange reason the system does not do this for subforms that do not have an Input:file object.

I found out you cannot include the foreign key field in a subform that uses an Input:file object because the system already takes care of updating that field. By including the foreign key in the browse subform, I was creating the duplicate SQL field. FYI, nuBuilder creates the SQL statement in nuUpdateDatabase() at line 201 of nudata.php. Here the system has already taken care of the record ID and the foreign key of the subform, then it finishes building the SQL statement for the update. If you include the foreign key in your browse subform, it will create it twice. For some strange reason the system does not do this for subforms that do not have an Input:file object.
TonyD