Welcome to the nuBuilder Forums!

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

Subform: empty records

Locked
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Subform: empty records

Unread post 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.
BR
Rui
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: Subform: empty records

Unread post by ruiascensao »

Hi,

Could you please help me?
BR
Rui
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Subform: empty records

Unread post 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
You do not have the required permissions to view the files attached to this post.
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: Subform: empty records

Unread post 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
You do not have the required permissions to view the files attached to this post.
BR
Rui
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: Subform: empty records

Unread post 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?
BR
Rui
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Subform: empty records

Unread post 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
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: Subform: empty records

Unread post by ruiascensao »

Hi Massiws,

Thank you!
It was very helpfull.
BR
Rui
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Subform: empty records

Unread post by admin »

.
Locked