Subform entries are not saved on third subform

Questions related to using nuBuilder Forte.

Subform entries are not saved on third subform

Postby fpdragon » Fri Jul 05, 2019 6:12 pm

Hi and sorry for my confused problem report but I'm pretty desperate now and I don't know where to look at.

I have a form with some values and one subform.
The subform also has some values.

First everything was working for some days but then it seems that I changed something and now new entries in the subform table are not saved any more.
I am still able to create new lines and fill the data but when I click on "Save" everything disappears.
Nothing is saved in the SQL DB.
All other fields of the main form are saved. It seems to be a problem with the subform itself.

I double and triple checked the following things:
subform.ID
subformGUIObject.Subform.Form
subformGUIObject.Subform.ForeignKey
subformObject.Main.Table Name
subformObject.Main.Primary Key
subformObject.Browse.SQL (working SQL statement in phpMyAdmin)

The zzzzsys_debug SQL table only has error messages regarding trl_english. I guess it has something to do with the translations.

I also have a similar construct with a form and subform that is still working but I don't see a structural difference in the configuration.

I could need a hint where the problem could be? What can cause a subform to be not able to save?

Thank you all.

Edit 1:
I just added one subelement directly into the SQL with phpmyadmin. It seems that nubuilder is able to show this manually entered subvalue. But it is still not possible to add an item or remove the manually created one.
I also double checked the SQL access rights and everything seems to be ok.
Last edited by fpdragon on Mon Jul 08, 2019 4:53 pm, edited 2 times in total.
fpdragon
 
Posts: 38
Joined: Wed May 29, 2019 10:20 pm

Re: Subform entries are not saved

Postby fpdragon » Mon Jul 08, 2019 4:51 pm

I just investigated a strange behavior:

It seems that only two of three subforms are working on one main form but the third subform isn't saved.
Each of the subforms is on it's own tab.
I can reorder the subforms and it stays always the last subform on the rightmost tab that isn't working. So it seems that it has nothing to do with the subform itself.
Very very strange.
I even recreated the tabs and recreated the subform objects but still it's always the subform on the rightmost tab.

Is this a known problem?
Any workarround?
fpdragon
 
Posts: 38
Joined: Wed May 29, 2019 10:20 pm

Re: Subform entries are not saved on third subform

Postby fpdragon » Mon Jul 08, 2019 6:19 pm

I just noticed another difference in the third subform.

Only one of the three subforms has in the top right corner a three dot menu.
But I still don't see any difference in the configuration.
fpdragon
 
Posts: 38
Joined: Wed May 29, 2019 10:20 pm

Re: Subform entries are not saved on third subform

Postby Janusz » Mon Jul 08, 2019 6:35 pm

Hi, are you able to create and post simple .sql example of the case you are describing.
Than we could have a look on it.

In my case I have forms with 2 subform on it and works fine.
In the past I was noticing some issues that if you enter several records on one subform at the same time without saving after each raw - there was some issues - but do not remember now what was exacty the point. To avoid this specific issue I added to the subform field the "onchange nuSaveAction()" to be sure that each raw after editing is saved. But such solution is very specifi to the subform structure - in my case I have just one field to be updated by the user on the subform so it was easy.
Janusz
 
Posts: 220
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Subform entries are not saved on third subform

Postby kev1n » Mon Jul 08, 2019 6:39 pm

The "Access Levels" form consists of 3 subforms and there are no saving issues.
kev1n
 
Posts: 242
Joined: Mon Oct 15, 2018 2:13 am

Re: Subform entries are not saved on third subform

Postby fpdragon » Mon Jul 08, 2019 8:10 pm

Janusz wrote:Hi, are you able to create and post simple .sql example of the case you are describing.
Than we could have a look on it.

In my case I have forms with 2 subform on it and works fine.
In the past I was noticing some issues that if you enter several records on one subform at the same time without saving after each raw - there was some issues - but do not remember now what was exacty the point. To avoid this specific issue I added to the subform field the "onchange nuSaveAction()" to be sure that each raw after editing is saved. But such solution is very specifi to the subform structure - in my case I have just one field to be updated by the user on the subform so it was easy.


Thank you for your answer!

I have 3 different subforms in one main form (for testing I added all subforms to the first tab and removed other tabs).
Depending on the sorting of the subforms in the tabe zzzzsys_form always the last subform listed in this table can't be saved or edited. So the order in zzzzsys_form seems to be relevant. The first two forms are always working. I changed the order and I can confirm that it has nothing to do with the subforms itself. Just the last one is not saved.

regarding your comment I added the following to the not working subform gui object:
Custom Code:
Event: onchange
Javascript: nuSaveAction()

Nothing changed.

Currently I see no chance to create a sql dump. If I have no progress then I may have to build something like that later.
fpdragon
 
Posts: 38
Joined: Wed May 29, 2019 10:20 pm

Re: Subform entries are not saved on third subform

Postby fpdragon » Mon Jul 08, 2019 8:13 pm

kev1n wrote:The "Access Levels" form consists of 3 subforms and there are no saving issues.


That's interesting. Thank you.

However I'm still clueless. "Access Levels" form seems to work but my application form does not.
fpdragon
 
Posts: 38
Joined: Wed May 29, 2019 10:20 pm

Re: Subform entries are not saved on third subform

Postby fpdragon » Mon Jul 08, 2019 8:30 pm

I just added a 4th subform:
first 2 subforms are working. The 2 others are not working.

Then I remove the 3rd subform:
2 subforms working last one not working.

Then I removed the last and newly created subform.
All 2 subforms are working.

This confirms that for me only the first two subforms can be saved respecting the order in zzzzsys_form.

:-(
fpdragon
 
Posts: 38
Joined: Wed May 29, 2019 10:20 pm

Re: Subform entries are not saved on third subform

Postby fpdragon » Mon Jul 08, 2019 9:58 pm

I am currently trying to step in deeper and added some javascript breakpoints.

What I can say currently that in
nuformclass.js
nuFormObject->data(action = 'save')

there is the variable d.
In it there are 4 array elements:
"nuBuilder4EditForm" + subform1 + subform2 + subform3
in subform3 I added an element and I can confirm that
d[3].rows contains the newly created line
d[3].edited contains [0, 1, 0, 0]
(no idea what this means. if this should mark the column that has changed then I would expect [0, 1, 1, 0])
fpdragon
 
Posts: 38
Joined: Wed May 29, 2019 10:20 pm

Re: Subform entries are not saved on third subform

Postby fpdragon » Mon Jul 08, 2019 11:03 pm

OMG
I think I just found out something that is of interest.

It depends on the size of the data if the other subforms are saved or not.

let's say I have 3 subforms
subform1
subform2
subform3

This configuration is working fine
subform1 2 lines
subform2 2 lines
subform3 2 lines

But with this data there comes the problem:
subform1 8 lines (can be edited)
subform2 2 lines (CAN'T be edited)
subform3 2 lines (CAN'T be edited)

So there seems to be a limitation on the maximum data that can be updated or edited.
Now I have to find out where the limitation comes from and what exactly is the maximum that is possible to be used.

It would be nice if you have any ideas how to debug and or solve this.

Thx
fpdragon
 
Posts: 38
Joined: Wed May 29, 2019 10:20 pm

Next

Return to General