Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Subform not saving properly

Questions related to using nuBuilder Forte.
Post Reply
alf1976
Posts: 75
Joined: Tue Dec 26, 2017 8:58 pm

Subform not saving properly

Unread post by alf1976 »

my subform looks like this:
component.png
If i alter any of the input fields or change any of the lookups from blank to a value the subform saves correctly.

However if i then delete the contents of any any lookup fields (in the red box) and then save it fails and the subform reverts to the back to the original stored version. Once the subform has failed once it will not save properly again until i leave and re-enter the main record.
To try and debug the issue i added BeforeSave JavaScript event to the form dumping the nuSubformObject('EstimateComponents') to the console.log(). From this the correct fields are showing as being 'edited' but nuDebug error is:-

Code: Select all

===USER==========
globeadmin
===PDO MESSAGE=== 
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE `EstCompID` = '17'' at line 1
===SQL=========== 
UPDATE EstComp SET  WHERE `EstCompID` = '17';
===BACK TRACE====
/volume1/web/nuBuilder/nudata.php - line 320 (nuRunQuery)
/volume1/web/nuBuilder/nuapi.php - line 50 (nuUpdateDatabase)
so even though fields have been edited there are no fields listed after the SET statement causing the SQL error

I use an identical method on the main record with exactly the same field structure and functions and these behave fine and do not cause any issue. It's just on the sub form where it is causing an issue.
finish.png
Any help would be greatly appreciated.
You do not have the required permissions to view the files attached to this post.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Subform not saving properly

Unread post by admin »

alf1976,

It could be because you have a Subform inside another Subform.

nuBuilder Forte can't do that.

BTW I like that style you have added.

Steven
alf1976
Posts: 75
Joined: Tue Dec 26, 2017 8:58 pm

Re: Subform not saving properly

Unread post by alf1976 »

Hi Steven,

There is no subform within a subform. If i could do that the design would have been be alot more elegant.
The subform does save around 68 fields . Could this be an issue? i tried to replicate with a far
more simplier example but that worked fine
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: Subform not saving properly

Unread post by shane »

I think the problem is with the settings in your php.ini file.

You will need to increase the value for max_input_vars.

It is safe to add a couple of zeros to whatever your default setting is.

Don't forget to restart start apache after changing your php.ini settings
alf1976
Posts: 75
Joined: Tue Dec 26, 2017 8:58 pm

Re: Subform not saving properly

Unread post by alf1976 »

Hi Shane,

That worked. The default value was only set at 1000.
I would have never of thought of that.
Thank you very much.

Andrew
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Subform not saving properly

Unread post by admin »

.
Post Reply