Page 1 of 1

Subform: empty records

Posted: Fri Jan 18, 2013 11:03 am
by ruiascensao
Hi,

I have a subform that deletable='NO'
Everytime I save it creates empty record.

If I turn deletable='yes' this does not happen.

How can I solve this problem?

Thank You.

Re: Subform: empty records

Posted: Mon Jan 21, 2013 11:34 am
by ruiascensao
Hi,

Could you please help me?

Re: Subform: empty records

Posted: Mon Jan 21, 2013 2:56 pm
by massiws
Rui,
are you saying that when you save the main form, without subform records, nuBuilder creates an empty subform record?
And what happen if you insert a new record in subform? Are the subform records correctly saved? Are the subform records linked properly with main table?

I've made some tests with my subform and this don't happen...
Here my settings (main table: repair; sub-table: repair_job)

Max

Re: Subform: empty records

Posted: Thu Jan 24, 2013 12:35 pm
by ruiascensao
Hi Massiws,

Yes, it creates empty records.
The new record is correctly saved in the database.
Please see attached pictures. It seems the number of empty records = subforms Blank Rows settings.
subform1.png
subform2.png
subform3.png
Thank you.

BR
Rui

Re: Subform: empty records

Posted: Thu Jan 24, 2013 12:44 pm
by ruiascensao
Hi Massiws,

I just notice that if I delete the record from the main form the records of the subform remains in the database.


Any idea on this issue?

Re: Subform: empty records

Posted: Thu Jan 24, 2013 4:51 pm
by massiws
Rui,

I checked better: you are right, sorry! :o

It's seems that nuBuilder creates so many empty records as the number in Blank Rows field: setting Deletable=Yes the problem don't appear.

I read and follow this post, about the same problem: http://forums.nubuilder.cloud/viewtopic.php?f=4&t=7609, but also rewriting the SQL in subform like example in the post, I can't be able to solve.
With Deletable=No, the only workaround I found is set Blank Rows=1.
Here another solution: http://forums.nubuilder.cloud/viewtopic.php?f=6&t=7606
ruiascensao wrote:I just notice that if I delete the record from the main form the records of the subform remains in the database.
Any idea on this issue?
This can be done using the #id# hash variable and custom PHP code in AfterSave tab.

Max

Re: Subform: empty records

Posted: Sat Jan 26, 2013 2:24 pm
by ruiascensao
Hi Massiws,

Thank you!
It was very helpfull.

Re: Subform: empty records

Posted: Thu Jan 31, 2013 7:42 am
by admin
.