Page 1 of 2
Subform not saving consistently
Posted: Wed Sep 11, 2019 3:15 am
by chpwebmaster
BillingForm.png
I have a billing form (pictured above) that is not saving changes to the main charges/payments subform consistently on records like the one shown adding a payment and hitting the save button saves no problem but forms that have monthly charges dating back years that I have to scroll to the bottom of sometimes save but most are not saving. The nuDebug log states syntax error and the SQL is " UPDATE tblCurrentRentedUnits SET WHERE `BillingID` = '12193'; " for new subform rows that aren't saving. Shouldn't it be running an INSERT for the new record? Editing just the Notes or other main form fields I have had no problem saving on those records that fail on subform inserts.
Re: Subform not saving consistently
Posted: Wed Sep 11, 2019 8:13 am
by kev1n
Hi,
Are you using an auto increment primary key? This can lead to issues while saving and is not recommended.
Recommended Table Structure:
https://wiki.nubuilder.net/nubuilderv3/ ... _Structure
Naming conventions:
https://wiki.nubuilder.cloud/ ... onventions
More about this topic:
https://forums.nubuilder.cloud/viewtopic. ... it=varchar
Re: Subform not saving consistently
Posted: Wed Sep 11, 2019 6:13 pm
by chpwebmaster
After testing with changing my primary and foreign keys for the main tables to varchar(25) and running a cascading update against them based on the
https://forums.nubuilder.cloud/viewtopic. ... har#p17363 Code: Select all
UPDATE `entreprise` SET `entreprise_id2`= LEFT(MD5(UUID()),15)
code and I'm still seeing the same thing happening i'm getting
Code: Select all
UPDATE tblCurrentRentedUnits SET WHERE `BillingID` = 'f4d2ec4cb9c0bf7';
queries run when adding rows to the longer histories
that table is also the main table not the subform table it's called tblCharges_Payments
Re: Subform not saving consistently
Posted: Thu Sep 12, 2019 4:44 am
by kev1n
Apart from seeing an error in nuDebug log, are changes still saved inconsistently?
Are you using the latest update?
Re: Subform not saving consistently
Posted: Thu Sep 12, 2019 11:01 pm
by chpwebmaster
I figured out why it's adding a debug error. Since it's only attempting to save for the subform there are no changes to the main form. I am using the latest release from sourceforge and it is not saving on subform inserts consistently.
Re: Subform not saving consistently
Posted: Fri Sep 13, 2019 3:02 am
by chpwebmaster
Update I just saw
https://forums.nubuilder.cloud/viewtopic.php?f=20&t=10015 Which sounds almost exactly like the problem I'm having however the version on the main sourceforge page under project activity isn't showing the update but I see it under files now so I will try tomorrow to run the update (I have to make sure I verify/reapply a change I made to output pdf's as files when run and my custom scripts folder) but I'll give it a shot.
Re: Subform not saving consistently
Posted: Fri Sep 13, 2019 3:31 pm
by chpwebmaster
Alright I just tried the new version both on my autonumber columns as well as resetting them to the hex UUIDs and they save if there are less than 25-30 rows for me.
Re: Subform not saving consistently
Posted: Fri Sep 13, 2019 8:36 pm
by Janusz
Hi,
With my specific subform I have it working up to 58 records. If I reduced the number of fields in the subform then I could add few more records.
You wrote it's OK up to about 30 records.
So the conclusion for me was - there is some limitation for total "data container"
and following this path I increased in the php.ini following variable:
max_input_vars 2000 (default is 1000)
and clould easilly go to more then 100 records

Re: Subform not saving consistently
Posted: Fri Sep 13, 2019 9:43 pm
by chpwebmaster
I'm using php7.3 and have max_input_vars set to 1000000000 to try to eliminate any problem.
Re: Subform not saving consistently
Posted: Fri Sep 13, 2019 10:12 pm
by chpwebmaster
I just checked PHP 7.0 and 7.2 with MAMP and they both work so I'm rolling php on my server back to 7.2